Case of
This presentation is the property of its rightful owner.
Sponsored Links
1 / 6

Case … of … PowerPoint PPT Presentation


  • 48 Views
  • Uploaded on
  • Presentation posted in: General

Case … of …. grade?. grade = ‘F’. grade = ‘B’. grade = ‘A’. grade = ‘D’. display “very good”. display “good”. display “fair”. display “poor”. case grade of ‘A’ : writeln(‘very good’); ‘B’ : writeln(‘good’); ‘D’ : writeln(‘fair’); ‘F’ : writeln(‘poor’); end;.

Download Presentation

Case … of …

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Case of

Case … of …


Case of

grade?

grade = ‘F’

grade = ‘B’

grade = ‘A’

grade = ‘D’

display “very good”

display “good”

display “fair”

display “poor”


Case of

case grade of

‘A’ : writeln(‘very good’);

‘B’ : writeln(‘good’);

‘D’ : writeln(‘fair’);

‘F’ : writeln(‘poor’);

end;


Case of

case <selector(integer/char/boolean)> of

<case label 1> : <statement 1>;

<case label 2> : <statement 2>;

<case label N> : <statement N>;

end;


Case of

Example 1

case number of

2,3,5,7 : numbertype:=‘prime’;

4,6,8,9,10 : numbertype:=not prime’;

end;


Case of

Example 2

case letter of

‘F’,’f’ : begin

female:=female + 1;

writeln(‘one female’);

end;

‘M’,’m’:begin

male:=male+1;

writeln(‘one male’);

end;

end;


  • Login