Gate 2015 pyq C Programming | Consider the C program: int main(){int i, j, k = 0; j=2*3/4+2.0/5+8/5;

Опубликовано: 15 Октябрь 2024
на канале: Gate CS pyqs - the other way [Eng]
424
18

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 less_than5; 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 _______.