Advertisement
Advertisement

Q.

Study the following ā€˜Cā€™ program

#include <stdio.h>
void main ()
{ 
    int a = 7, b = 5;
    switch (a/a % b)
    { 
         case 1 : a = a-b;
         case 2 : a = a+b;
         case 3 : a = a*b;
         case 4 : a = a/b;
         default : a = a;
    } 
}

One the execution of above program, what will be the variable a?

A 2
B 5
C 7
D 12
Answer & Explanation
Option: [C]
Advertisement
Advertisement

Your Valuable Comments Please...

Advertisement
Subscribe to Gkseries
Work with Gkseries
Gkseries ebooks

Please Join Our Discussion Group