Pages

Monday, January 7, 2019

ASD 5

ASD 5
program PemilihanIF;
Var
   nilai: integer;
begin
     Write('Ketikkan nilai: '); readln(nilai);
     If nilai > 89 then
        Writeln('Sangat Baik');

        If nilai > 79 then
           Writeln('Baik')
           else
               Writeln('Kurang');

Readln;
end.

==========
ASD 5b
program PemilihanCase;
Var
   nilai: integer;
begin
     Write('Ketikkan nilai: '); readln(nilai);
     Case nilai of
     90..100:Writeln('Sangat Baik');
     80..89:Writeln('Baik');
     else
     Writeln('Kurang');
     end;
readln;
end.

====
ADS 5c
program PengulanganFor;
var
   n,i: integer;
begin
     write('Ketik banyaknya bilangan '); readln(n);
     for i:= 1 to n do
         writeln(i);
readln;
end.

====
ADS 5d
program PengulanganForDown;
var
   n,i: integer;
begin
     write('Ketik banyaknya bilangan: '); readln(n);
     for i:= n downto 1 do
         writeln(i);
readln;
end.

====

ASD 5e
program PengulanganForKali;
var
   x1,x2: integer;
begin
     For x1:= 1 to 5 do
         begin
              x2:=x1*x1;

              writeln(x1:3,x2:10);
         end;
readln;
end.


Bitcoin Offers:
Free Bitcoin, Double Bitcoin, Bitcoin Investment, Bitcoin Trading



"Bitcoin and Forex are high risk business. We must join them smartly."

No comments:

Post a Comment