PROGRAM IF2 Uses wincrt VAR AGE INTEGER BEGIN
PROGRAM IF_2; Uses wincrt; VAR AGE : INTEGER; BEGIN WRITELN(‘กรณาปอนอาย ’); READLN(AGE); IF AGE > 25 THEN BEGIN WRITELLN(‘คณแกแลว ’); WRITELN(‘อายคณคอ ’, AGE); END ELSE BEGIN WRITELN(‘คณยงเปนวยรน ’); WRITELN (‘อายคณคอ ’, AGE); END.
โปรแกรม check grade • • • • • • Program grade; Uses wincrt; Var score : integer; Begin Write('input your score '); readln(score); If(score >=80) and (score <=100) Then write('******A******') else If(score >=75) and (score <=79) Then write('******B+******') else If(score >=70) and (score <=74) Then write('******B******') else If(score >=65) and (score <=69) Then write('******C+******') else If(score >=60) and (score <=64) Then write('******C******') Else If(score >=55) and (score <=59) Then write('******D+******') else If(score >=50) and (score <=54) Then write('******D******') else write('*****E*****'); End.
- Slides: 8