Programan pascal (lanjutan)

Arwan Prianto Mangidi
0


Program Tabel Daftar Perkalian Angka Ganjil

PROGRAM F1A316006_ARWAN_PRIANTO_MANGIDI;
uses Wincrt;
var  i,x,a,c : integer;
Begin
Clrscr;
       Writeln('--------Perkalian Angka Ganjil-------');     Writeln('_______________________________________________');  Writeln('|     |                                        |');
Writeln('|  x  |     1     3     5     7     9    11    |');         Writeln('|_____|________________________________________|'); Writeln('|     |                                        |');
       For i:= 1 to 10 do
       Begin
            Write('|',i:3,'  |');
            For x:= 1 to 6 do
            Begin
                 C:=2*x-1;
                 Write(i*c:6);
            End;
            Writeln('    |');
       End;       writeln('|_____|________________________________________|');
Readln;
End.

   Program Deret

PROGRAM F1A316006_ARWAN_PRIANTO_MANGIDI;
USES WINCRT;
VAR  a,b,c,i,x,j,f,w :longInt;
BEGIN
Clrscr;
       Writeln;
       Writeln('      Deret ( i + 6)^2 +7');
       Writeln(' ----------------------------');
       Writeln;
       a:=6; b:=0;  w:=7;
       For j:= 1 to 1 do
       BEGIN
            f :=Sqr(j+a)+w;
            Write('(',j+a,')^2+',w);
            For i:= j+1 to 11 do
            Begin
                 c :=Sqr(i+a)+w;
                 b :=b + c;
                 Write('+(',i+a,')^2+',w);
            End;
       END;
       Writeln('=',b+f);
Readln;
END.

Program Susunan Angka

PROGRAM F1A316006_ARWAN_PRIANTO_MANGIDI;
USES WINCRT;
VAR  i,x,a,n :Integer;
BEGIN
Clrscr;
       Writeln('----Susunan Angka Menurun---');
       Writeln;
       Write('input jumlah angka = ');Readln(n);
       Writeln;
       For i:= 1 to n do
       BEGIN
            a:=i-1;
            For x:= 1 to n-a do
            Write(x,' ');
            Writeln;
       END;
       Readln;
END.

Program Penjumlahan Menurun

PROGRAM F1A316006_ARWAN_PRIANTO_MANGIDI;
uses Wincrt;
var  i,x,b,n,y,c : integer;
Begin
Clrscr;
      
       Write('Input nilai = ');readln(n);
       writeln;
       i:= 1;  c:=2;
            For x:= 1 to n do
            Begin
                 b:=1;
                 Write(i);
                 b:=0;
                 For y:= 2 to x do
                     Begin
                          Write('+':1,y:2);
                          b:=b+y;
                     End;
                     b:=b+i;
                     gotoxy(3*n,x+2);Writeln('=',b:3);
            End;
            Writeln('');

Readln;
End.

Posting Komentar

0 Komentar
Posting Komentar (0)