Anda di halaman 1dari 6

I.

Program Nama dan NIM Sederhana

program Latihan_1; uses crt; var nama, nim:string; begin clrscr; write(' Nama Anda : ');readln(nama); write(' NIM Anda : ');readln(nim); writeln(' Nama : ' , nama); writeln(' NIM : ' , nim);readln; readln; end.

II.

Program Nama dan NIM

program Latihan_2; uses crt; var nama, nim:string; begin clrscr; writeln('Program Perkenalan');readln; write(' Nama Anda: ');readln(nama); write(' NIM Anda: ');readln(nim);

writeln('************************** '); writeln('* Nama saya adalah ' , nama , ' * '); writeln('* NIM saya adalah ' , nim , ' * '); writeln('************************** '); readln; end.

III.

Program

program Latihan_3; uses crt; var a,b:integer; begin clrscr; write(' Masukkan Nilai a: ');readln(a); write(' Masukkan Nilai b: ');readln(b);

writeln(' Jadi, a + b = ' , a + b);readln; end.

IV.

Program

program Latihan_4; uses crt; var a:integer; begin clrsr; write('Masukkan Nilai a = ');readln(a); writeln(a , ' ^2 = ' , sqr(a));readln; end.

V.

Program

program Latihan_5; uses crt; var a,b:integer; begin clrscr; write('Masukkan Nilai a = ');readln(a); b:= a*a*a; writeln(a , ' ^3 = ' , b);readln; end.

VI.

Program

program Latihan_6; uses crt; var a:integer; b:real; begin clrscr; write('Masukkan Nilai a = ');readln(a); writeln(a , ' ^1/3 = ' , exp(1/3*ln(a)));readln; end.