This becomes more readable with indentation:
READ A
READ B
READ C
IF C>A THEN
IF C>B THEN
PRINT "C must be smaller bla bla.."
ELSE
PRINT "Proceed to next stage"
ENDIF
ELSE
PRINT "B CAN BE SMALLER THEN C"
ENDIF
Statement coverage requires each statement to be executed, whereas branch coverage requires each branch (or decision) to be executed.
Usually, 100% branch coverage implies 100% statement coverage, but not necessarily vice versa. However, in this example both IF
s have ELSE
branches and, therefore, you have to execute all branches to reach each statement.
An example where statement coverage is not the same as branch coverage:
READ X
READ Y
IF X > Y
X = X + 1
ENDIF
PRINT X
Here, statement coverage doesn't have to cover the case where X
is smaller or equals Y
—such that the line X = X + 1
isn't executed—which would be required with branch coverage.
If you are struggling with these questions, consider drawing a flow chart as shown, e.g., here: How to calculate Statement, Branch/Decision and Path Coverage for ISTQB Exam purpose