Program Solution01;
Uses Crt;
Const Number = 100;
Var i:Word;{0..65535}

{checker function}
Function PrimeOrNot(pon00:word):String;
  Var
    pon01  :Word;
    Counter:Word;
  Begin
    Counter:=0;
    For pon01:=1 To pon00 Do
      Begin
        If (pon00 Mod pon01 = 0) Then
          Begin
            Counter:=Counter+1;
          End;{if}
      End;{for}
    If (Counter = 2) Then
      Begin
        TextColor(10);
        PrimeOrNot:=' Prime.';
      End
    Else Begin
          TextColor(15);
          PrimeOrNot:=' Not Prime.';
         End;{if}
  End;{function}

Begin {main}
   For i:=0 To Number Do
   WriteLn(i:3,PrimeOrNot(i));
   ReadLn;
End.

{
-= Note By FlamingClaw =-

All programs created by me  are written and tested
in Dev Pascal and/or Turbo Pascal 7.0

-= Created By FlamingClaw =-
-=2009.03.31=-
}
1
Contributor
0
Replies
1
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.