Advertisement
rayhanf

1

Apr 28th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.35 KB | Source Code | 0 0
  1. var
  2.     x: array[1..10] of integer;
  3.     i, terbesar: integer;
  4.  
  5. begin
  6.     for i:=1 to 10 do begin
  7.         write('Data ke-', i, ': ');
  8.         readln(x[i]);
  9.     end;
  10.     // di awal dimisalkan bahwa data terbesar adalah X[1]
  11.     terbesar := x[1];
  12.     for i:=2 to 10 do begin
  13.         if x[i] > terbesar then
  14.             terbesar  := x[i];
  15.     end;
  16.     writeln('Terbesar: ', terbesar);
  17.     readkey;
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement