Let's learn how to use 'IF CLAUSE' in
Turbo Pascal
- If clause is used in 3 types.
IF/THEN/ENDIF
IF/THEN/ELSE/ENDIF
NESTED IF
I WILL TEACH YOU HOW TO USE 'IF/THEN/ENDIF' TYPE IN THIS ARTICLE
IF/THEN/ENDIF
IF/THEN/ELSE/ENDIF
NESTED IF
PROGRAM LRG_TEN;
VAR NUM: INTEGER;
BEGIN
WRITELN('ENTER THE NUMBER');
READ(NUM);
IF NUM>10 THEN;
WRITELN('NUMBER IS GREATER THAN TEN');
READLN;
END.
In the above program you can see there is a line as 'IF NUM>10 THEN'. This shows the condition that is need to be proved. The user will see as'NUMBER IS GREATER THAN TEN' if the condition is fulfilled. But there is a disadvantage of using this case. The disadvantage is the user can't see anything if the condition is not fulfilled. You can learn how to use the IF/THEN/ELSE/ENDIF case in my next article.


