program aritmatik;
uses wincrt;
var x: real;
begin
clrscr;
write('Masukkan nilai dari x = ');
readln(x);
if x<0 then x:=abs(x);
writeln('nilai x = ',x:5:2);
writeln('nilai eksponensialnya = ',exp(x):9:3);
writeln('nilai logaritma naturalnya = ',ln(x):9:3);
writeln('nilai integernya = ',int(x):9:3);
writeln('nilai fraksionalnya = ',frac(x):9:3);
writeln('nilai x dipangkatkan = ',sqr(x):9:3);
writeln('nilai x diakarkan = ',sqrt(x):9:3);
write('nilai x jika dimasukkan dalam ');
writeln('fungsi sin,cos,dan tangen: ');
writeln('- sinus = ',sin(x):9:3);
writeln('- cosinus = ',cos(x):9:3);
writeln('- tangen = ',arctan(x):9:3);
end.
Program Aritmatik
06.26 |
Label:
Contoh Program Pascal
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar