ex::IF (CONDITION)
statement
statement
ENDIF
Q1) if we have several if's we add several endif's?
that is::
IF (condi)
statmt
IF (cond)
Stmt
IF (cd)
st
END IF (once or thrice??)
Q2)
(example is given on a site why does the first one use several ENDIF and the other only one
Example1::
IF mark >= 80 THEN
grade = "A"
comment = "Excellent"
ELSE
IF mark >= 70 THEN
grade = "B"
ELSE
IF mark >= 60 THEN
grade = "C"
ELSE
IF mark >= 50 THEN
grade = "D"
ELSE
grade = "N"
comment = "Poor"
ENDIF
ENDIF
ENDIF
ENDIF
Example2:::
IF mark >= 80 THEN
grade = "A"
comment = "Excellent"
ELSE IF mark >= 70 THEN
grade = "B"
ELSE IF mark >= 60 THEN
grade = "C"
ELSE IF mark >= 50 THEN
grade = "D"
ELSE
grade = "N"
comment = "Poor"
ENDIF
2007-07-28
22:50:51
·
3 answers
·
asked by
Doopy D
1
in
Computers & Internet
➔ Programming & Design