GATEverse
← GATE CSE 2017 Set 1

Q43

NAT2 marks

Consider the following grammar: stmt →\rightarrow if expr then expr else expr; stmt | OˋÒ expr →\rightarrow term relop term | term term →\rightarrow id | number id →\rightarrow a | b | c number →[0−9]\rightarrow [0-9] where relop is a relational operator ((e.g., <,>,…),< , >,\ldots), OˋÒ refers to the empty statement, and if, then, else are terminals. Consider a program PP following the above grammar containing ten if terminals. The number of control flow paths in PP is________ . For example. the program if e1e_1 then e2e_2 else e3e_3 has 22 control flow paths. e1→e2e_1 \rightarrow e_2 and e1→e3e_1 \rightarrow e_3.

Sign in to save attempts.

Loading…