<Example Program 1>
Program ifthen_example_1 Integer x Read *, x If (Mod(x,2)==0) Then Print *, 'even',x End If End |
|
![]() 4 ![]() even 4 |
<Example Program 2>
Program ifthen_example_2 Integer x Read *, x If (Mod(x,2)==0) Then Print *, 'even' If (x==4) Then Print *, 'four' End If End If End |
|
![]() 2 ![]() even |
|
![]() 4 ![]() even four |