09.10.2014 Views

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Flow Diagram:<br />

Example:<br />

The following example illustrates the concept:<br />

program checkCase;<br />

var<br />

grade: char;<br />

begin<br />

grade := 'F';<br />

case (grade) of<br />

'A' : writeln('Excellent!' );<br />

'B', 'C': writeln('Well done' );<br />

'D' : writeln('You passed' );<br />

else<br />

writeln('You really did not study right!' );<br />

end;<br />

writeln('Your grade is ', grade );<br />

end.<br />

When the above code is compiled and executed, it produces the following result:<br />

You really did not study right!<br />

Your grade is F<br />

TUTORIALS POINT<br />

Simply Easy Learning Page 41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!