A
Q. When 1 is entered, the output of the code below is?
Code:
#include <stdio.h>
void main()
{ int ch;
printf(“enter a value btw 1 to 2:”);
scanf(“%d”, &ch);
switch (ch, ch + 1)
{
case 1:
printf(“1
”);
break;
case 2:
printf(“2”);
break;
}
}
void main()
{ int ch;
printf(“enter a value btw 1 to 2:”);
scanf(“%d”, &ch);
switch (ch, ch + 1)
{
case 1:
printf(“1
”);
break;
case 2:
printf(“2”);
break;
}
}
- Correct Answer - Option(B)
- Views: 29
- Filed under category C Programming
- Hashtags:
Discusssion
Login to discuss.