Bilangan Prima Delphi (Console Aplication)

oleh :
kelompok 12

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
a,b,c,x : integer;

BEGIN
      write('Masukan Bilangan Prima sampai : '); readln(x);
      for a:= 1 to x do
      Begin;
      c:=0;
      for b:=1 to a do
      Begin;
      if a mod b=0 then
      c:=c+1;
      end;

      if c=2 then
      begin;
      write(a,' ');
      write('');
      end;
      end;

      readln;
END.


Ibu Kota, 26 juni 2014

akhukumfillah arifzainurrohman

0 komentar:

Posting Komentar