Page 1 of 1

Consider the following C program. What is the Value of a?

Posted: Thu Jul 14, 2022 9:07 am
by answerhappygod
#include<stdio.h>
int 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;
}
return 0;
}
a) 7
b) 5
c) 9
d) None of the mentioned