Write an Pascal Program for Subrange Variables - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Saturday, September 23, 2017

Write an Pascal Program for Subrange Variables


Subrange Variables in Pascal


Program:
program exSubrange;
var
marks: 1 .. 100;
grade: 'A' .. 'E';

begin
writeln( 'Enter your marks(1 - 100): ');
readln(marks);

writeln( 'Enter your grade(A - E): ');
readln(grade);

writeln('Marks: ' , marks, ' Grade: ', grade);
end.
Output:
Enter your marks(1 - 100):
100
Enter your grade(A - E):
A

Marks: 100 Grade: A

No comments:

Post a Comment