Consider the following C program: #include<stdio.h> int main() { int i, j, k =…
GATE · 2015 · CS · Set 3 · Computer Science & IT
Consider the following C program:
#include<stdio.h>
int main()
{
int i, j, k = 0;
j = 2 * 3 / 4 + 2.0 / 5 + 8 / 5;
k -= --j;
for (i = 0; i < 5; i++)
{
switch (i + k)
{
case 1:
case 2: printf("\n%d", i+k);
case 3: printf("\n%d", i+k);
default: printf("\n%d", i+k);
}
}
return 0;
}The number of times printf statement is executed is ____________.
Attempted by 286 students.
Sign up free to check your answer
Sign up freeLoading lesson…