Kalau yang ane share kali ini adalah menggunakan array gan
uses crt;
label awal;
var a: [1..3] of integer;
sin_alpha, cos_alpha, tan_alpha,arctan1 : real;
x,n : integer;
begin clrscr;
awal:
writeln('TRIGONOMETRI 2');
write('Masukan sudut ke-1: ');readln(a[1]);
write('Masukan sudut ke-2: ');readln(a[2]);
write('Masukan sudut ke-3: ');readln(a[3]);
writeln('');
n:=3;
writeln('Jenis sudut | sin cos tan');
writeln('----------------------------------');
for x:=1 to n do begin
sin_alpha := sin(a[x]/57.28);
cos_alpha := cos(a[x]/57.28);
tan_alpha := sin_alpha/cos_alpha;
write('Sudut Ke - ',a[x], '|'); write(sin_alpha:6:2, ' '); write(cos_alpha:7:2, ' '); writeln(tan_alpha:7:2, ' ');
readkey;
end;
end.
uses crt;
label awal;
var a: [1..3] of integer;
sin_alpha, cos_alpha, tan_alpha,arctan1 : real;
x,n : integer;
begin clrscr;
awal:
writeln('TRIGONOMETRI 2');
write('Masukan sudut ke-1: ');readln(a[1]);
write('Masukan sudut ke-2: ');readln(a[2]);
write('Masukan sudut ke-3: ');readln(a[3]);
writeln('');
n:=3;
writeln('Jenis sudut | sin cos tan');
writeln('----------------------------------');
for x:=1 to n do begin
sin_alpha := sin(a[x]/57.28);
cos_alpha := cos(a[x]/57.28);
tan_alpha := sin_alpha/cos_alpha;
write('Sudut Ke - ',a[x], '|'); write(sin_alpha:6:2, ' '); write(cos_alpha:7:2, ' '); writeln(tan_alpha:7:2, ' ');
readkey;
end;
end.
No comments:
Post a Comment