Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Tugas3: Algoritma dan Pemrograman 2-PASCAL-looping

# Tugas3: Algoritma dan Pemrograman 2-PASCAL-looping

Ratings: (0)|Views: 1,503 |Likes:

### Availability:

See more
See less

05/11/2014

pdf

text

original

Nama: Dian Wahyu UtamiNPM: 10108579Kelas: 1 KA 20Tugas: Algoritma dan Pemrograman 2 – PASCAL-loopingSoal 1.Program untuk mencetak bilangan bulat dari 1 s/d N menggunakan strukturpengulangan Repeat-Until, While dan For. Nilai N diinputkan dari keyboard.A….PROGRAM FORTO1;USES CRT;CONST X = '========================================';VAR N,P: INTEGER;BEGINCLRSCR;WRITELN(X);WRITE('MASUKKAN SEBUAH NILAI : ');READLN(N);WRITELN;FOR P := 1 TO N DOWRITE(P,' ');WRITELN;WRITELN(X);READLN;END.

B….PROGRAM WHILEDO1;USES CRT;CONST X = '================================';VAR N,I : INTEGER;BEGINCLRSCR;WRITELN(X);WRITE('MASUKKAN SEBUAH NILAI : ');READLN(N);WRITELN;I := 0;WHILE I < N DOBEGINI := I + 1;WRITE(I,' ');END;WRITELN;WRITELN(X);READLN;END.

C….PROGRAM REPEATUNTIL1;USES CRT;CONST X = '::::::::::::::::::::::::::::::';VAR I,N : INTEGER;BEGINCLRSCR;WRITELN(X);WRITE('MASUKKAN SEBUAH NILAI : ');READLN(N);I := 1;WRITELN;REPEATWRITE(I,' ');I := I +1;UNTIL I > N;WRITELN;WRITELN(X);READLN;END.