Saturday, August 6, 2016

Repeat Until in Pascal

In this article I would like to share with you a sample program to demonstrate how to use repear loop statement in Pascal. In this sample program I am using Turbo Pascal 5.0 in DOS as my pascal compiler.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing


Program Repeat_Until_Loop;
Uses Crt;

Var A  : Integer;

Begin

  Clrscr;
  Write('Repeat Until Statement in Pascal');
  writeln;
  writeln;

  A := 1;
  Repeat

     Write(' ',A,' ');
     A := A + 1;
  Until (A=11);

   Writeln;
   Writeln;
  A := 10;
  Repeat
    Write(' ',A,' ');
    A := A - 1;
  Until (A=0);


  Readln;
End.


No comments:

Post a Comment