Forgotten password

Language

Bulgarian    English

Advertisements




Report a bug !
Add search function to you browser

Powered by PHP Powered by MySQL
Pascal емулатор
1 member(s) online
Size control Print  Language: Pascal

Examples://Code arrange


To solve the problem you should shift the code with your mouse to end up with working solution.

Problem:
One figure is simple if it is divided to 1 and itself. Write down a program that initiates integer N and defines if it is simple


  • begin
  • var N : longint;
  • while (k<=N div 2) and OK do
  • readln(N);
  • k := 2;
  • if OK then write('Yes')
  • end;
  • else write('No')
  • k : byte;
  • write('Enter N= ');
  • if N mod k = 0 then OK := false;
  • begin
  • OK := true;
  • end.
  • OK : boolean;
  • k := k+1