Program yang satu ini adalah sebuah program yang dapat menampilkan penjumlahan 1 sampai dengan 10, namun bukan itu tujuan pertama dalam postingan ini. Tujuannya adalah untuk mempelajari, memahami dan mempraktekkan logika programming yang terdapat di dalam scriptnya .
Program Tambah_W;
Uses Crt;
Var
I,H,J,K,L,M,N,O,P,Q : integer;
Begin
ClrScr;
I := 1;
While I < 11 Do
Begin
If I < 20 Then
Begin
Gotoxy(4,I); Write(I,' + 1 = ',I + 1);
End
Else
Begin
Gotoxy(4,I); Write(I,' + 1 = ',I + 1);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 2;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(18,I); Write(I,' + 2 = ',I + 2);
End
Else
Begin
Gotoxy(18,I); Write(I,' + 2 =',I + 2);
End;
End
Else
Begin
Gotoxy(17,I); Write(I,' + 2 = ',I + 2);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 3;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(32,I); Write(I,' + 3 = ',I + 3);
End
Else
Begin
Gotoxy(32,I); Write(I,' + 3 =',I + 3);
End;
End
Else
Begin
Gotoxy(31,I); Write(I,' + 3 = ',I + 3);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 4;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(46,I); Write(I,' + 4 = ',I + 4);
End
Else
Begin
Gotoxy(46,I); Write(I,' + 4 =',I + 4);
End;
End
Else
Begin
Gotoxy(45,I); Write(I,' + 4 = ',I + 4);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 5;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(60,I); Write(I,' + 5 = ',I + 5);
End
Else
Begin
Gotoxy(60,I); Write(I,' + 5 =',I + 5);
End;
End
Else
Begin
Gotoxy(59,I); Write(I,' + 5 = ',I + 5);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 6;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(4,I + 12); Write(I,' + 6 = ',I + 6);
End
Else
Begin
Gotoxy(4,I + 12); Write(I,' + 6 =',I + 6);
End;
End
Else
Begin
Gotoxy(3,I + 12); Write(I,' + 6 = ',I + 6);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 7;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(18,I + 12); Write(I,' + 7 = ',I + 7);
End
Else
Begin
Gotoxy(18,I + 12); Write(I,' + 7 =',I + 7);
End;
End
Else
Begin
Gotoxy(17,I + 12); Write(I,' + 7 = ',I + 7);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 8;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(32,I + 12); Write(I,' + 8 = ',I + 8);
End
Else
Begin
Gotoxy(32,I + 12); Write(I,' + 8 =',I + 8);
End;
End
Else
Begin
Gotoxy(31,I + 12); Write(I,' + 8 = ',I + 8);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 9;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(46,I + 12); Write(I,' + 9 = ',I + 9);
End
Else
Begin
Gotoxy(46,I + 12); Write(I,' + 9 =',I + 9);
End;
End
Else
Begin
Gotoxy(45,I + 12); Write(I,' + 9 = ',I + 9);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 10;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(60,I + 12); Write(I,' + 10 = ',I + 10);
End
Else
Begin
Gotoxy(60,I + 12); Write(I,' + 10 =',I + 10);
End;
End
Else
Begin
Gotoxy(59,I + 12); Write(I,' + 10 = ',I + 10);
End;
I := I + 1;
End;
Readkey;
End.
Selamat Mencoba, Semoga Bermanfaat :)
Fastabiqul Khairaats
Program Tambah_W;
Uses Crt;
Var
I,H,J,K,L,M,N,O,P,Q : integer;
Begin
ClrScr;
I := 1;
While I < 11 Do
Begin
If I < 20 Then
Begin
Gotoxy(4,I); Write(I,' + 1 = ',I + 1);
End
Else
Begin
Gotoxy(4,I); Write(I,' + 1 = ',I + 1);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 2;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(18,I); Write(I,' + 2 = ',I + 2);
End
Else
Begin
Gotoxy(18,I); Write(I,' + 2 =',I + 2);
End;
End
Else
Begin
Gotoxy(17,I); Write(I,' + 2 = ',I + 2);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 3;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(32,I); Write(I,' + 3 = ',I + 3);
End
Else
Begin
Gotoxy(32,I); Write(I,' + 3 =',I + 3);
End;
End
Else
Begin
Gotoxy(31,I); Write(I,' + 3 = ',I + 3);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 4;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(46,I); Write(I,' + 4 = ',I + 4);
End
Else
Begin
Gotoxy(46,I); Write(I,' + 4 =',I + 4);
End;
End
Else
Begin
Gotoxy(45,I); Write(I,' + 4 = ',I + 4);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 5;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(60,I); Write(I,' + 5 = ',I + 5);
End
Else
Begin
Gotoxy(60,I); Write(I,' + 5 =',I + 5);
End;
End
Else
Begin
Gotoxy(59,I); Write(I,' + 5 = ',I + 5);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 6;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(4,I + 12); Write(I,' + 6 = ',I + 6);
End
Else
Begin
Gotoxy(4,I + 12); Write(I,' + 6 =',I + 6);
End;
End
Else
Begin
Gotoxy(3,I + 12); Write(I,' + 6 = ',I + 6);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 7;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(18,I + 12); Write(I,' + 7 = ',I + 7);
End
Else
Begin
Gotoxy(18,I + 12); Write(I,' + 7 =',I + 7);
End;
End
Else
Begin
Gotoxy(17,I + 12); Write(I,' + 7 = ',I + 7);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 8;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(32,I + 12); Write(I,' + 8 = ',I + 8);
End
Else
Begin
Gotoxy(32,I + 12); Write(I,' + 8 =',I + 8);
End;
End
Else
Begin
Gotoxy(31,I + 12); Write(I,' + 8 = ',I + 8);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 9;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(46,I + 12); Write(I,' + 9 = ',I + 9);
End
Else
Begin
Gotoxy(46,I + 12); Write(I,' + 9 =',I + 9);
End;
End
Else
Begin
Gotoxy(45,I + 12); Write(I,' + 9 = ',I + 9);
End;
I := I + 1;
End;
I := 1;
While I < 11 Do
Begin
H := I + 10;
If I < 10 Then
Begin
If H < 20 Then
Begin
Gotoxy(60,I + 12); Write(I,' + 10 = ',I + 10);
End
Else
Begin
Gotoxy(60,I + 12); Write(I,' + 10 =',I + 10);
End;
End
Else
Begin
Gotoxy(59,I + 12); Write(I,' + 10 = ',I + 10);
End;
I := I + 1;
End;
Readkey;
End.
Selamat Mencoba, Semoga Bermanfaat :)
Fastabiqul Khairaats
0 comments:
Post a Comment