You are on page 1of 1

Test I: Give the flow chart of the following codes: Test II: Give the c code of the flow

f the flow chart below:


1.
if(x<2)x++; START
else{
if(x<5)x--;
else x+=2;
if(x<8)x*=2; T T x++
x<5 x>2
else x+=3;
}
F F
2.
if(x<2) { x+=2 x--
if(x<5)x--;
else x+=2;
if(x<8)x*=2;
else x+=3;
}
else x++;

Test III: Give the new value of x after the given programs: T x*=2
x<8
Used program from Test I No. 1.
1. x = 3
2. x = 4 F
3. x = 6
4. x = 8
5. x = 9 x+=3
Used program from Test I No. 2.
1. x = 3
2. x = 4
3. x = 6
4. x = 8
5. x = 9
Used program from Test II. END
1. x = 3
2. x = 4
3. x = 6
4. x = 8
5. x = 9

You might also like