PROG14.PAS 640 B

123456789101112131415161718192021222324252627
  1. PROGRAM PROG14;
  2. {$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
  3. New Topics: Procedure declaration
  4. Using procedures
  5. Using parameters
  6. Counter with error checking
  7. }
  8. VAR
  9. Count, Adjusted_Count : Integer;
  10. I, J, K : Integer;
  11. PROCEDURE Add(No_1, No_2 : Integer; VAR Sum : Integer);
  12. BEGIN
  13. Sum := No_1 + No_2;
  14. END;
  15. BEGIN
  16. Write('Enter count: ');
  17. ReadLn(Count);
  18. Add(2, Count, Adjusted_Count);
  19. WriteLn('Adjusted Count is: ',Adjusted_Count);
  20. END.
  21.