Back To Top

Naruto VS Sasuke,who is the strongest?

Monday, 30 June 2014

loop bahasa pascal

Program Output_Tengah_Tengah_Layar; 
 
Uses crt;
Var
  Xtengah, XGerak, N, I : Byte;
  Lagi : Char;
Begin
  Lagi:='Y';
  While (Upcase(Lagi)='Y') Do
     Begin
       clrscr;
       writeln('Banyak N : ');
       readln(N);
       A:=1;
       For I:=1 To N Do
          Begin
              K:=1;
             XGerak:=Xtengah;
             While (K<=A) Do
                Begin
                    Gotoxy(XGerak,I-1);
                    XGerak:=XGerak+1;
                    K:=K+1;
                End; {Akhir For J}
              XTengah:=XTengah-1;
              A:=A+2;
            End; { akhir For I}
            writeln;
            write('Anda Ingin Mencetak Lagi  : ');
            readln(Lagi);
        End; {Akhir while}
End.
 
 
layout :
                                       1
                                      111
                                     11111
                                    111111 

No comments:

Post a Comment

Visitor

Powered by Blogger.

Labels

Copyright © 2012 Bebin Cahyadi | Naruto Vs Sasuke V2 Theme | Designed by Johanes DJ