C Language MCQ - English
Which of the following cannot be checked in a switch-case statement?
Answer : C
Feel free to find and hire your online essay writer to help you with papers. AdvancedWriters will not let you down.
View More Related Question
1) What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input) #include <stdio.h>
void main()
{
char *ch;
printf("enter a value between 1 to 3:");
scanf("%s", ch);
switch (ch)
{
case "1": printf("1");
break;
case "2": printf("2");
break;
}
}
2) What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input) #include <stdio.h>
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch, ch + 1)
{
case 1: printf("1\n");
break;
case 2: printf("2");
break;
}
}
3) What is the output of this C code?
#include <stdio.h>
const int a = 1, b = 2;
int main()
{
int x = 1;
switch (x)
{
case a: printf("yes ");
case b: printf("no\n");
break;
}
}
4) Consider the following code snippet: marks =80;
What is the value of 'grade' after the switch statement is executed?
switch (marks)
{
case 60: grade = 'C';
break;
case 70: grade = 'B';
break;
case 80: grade = 'A';
break;
default: grade = 'E';
}
5) What is the output of this C code(When 1 is entered)?
#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\n");
break;
case 2: printf("2");
break;
}
}