CS608 Assignment No 1 2022
Question#1: Marks(10)
Draw Control Flow Graph (CFG) for the
following piece of code.
L1: Input
(a,b,c, operator);
L2:
Switch (Operator);
{
L3: Case ’+’:
c=a+b; break;
L4: Case ’-’:
c=a-b; break;
L5: Case ‘*’: c=a*b; break;
L6: Default : invalid;
}
L7: Output
(c);
Question#2:
Marks(10)
Find the complete paths from the Control
Flow Graph CFG, which you build as a
solution of question#1.
Note: Copied material will be graded “Zero”.
Download file: CS068
Question#1: Marks(10) Draw Control Flow Graph (CFG) for the
following piece of code. L1: Input
(a,b,c, operator); L2:
Switch (Operator); { L3: Case ’+’:
c=a+b; break; L4: Case ’-’:
c=a-b; break; L5: Case ‘*’: c=a*b; break; L6: Default : invalid; } L7: Output
(c); Question#2:
Marks(10) Find the complete paths from the Control
Flow Graph CFG, which you build as a
solution of question#1. Note: Copied material will be graded “Zero”. Download file: CS068 |