C Programming [MCQ] : Applications of C (Multiple Choice Questions)


Question 1
Nesting of if-else statements is allowed in C Programming.
A
No
B
Yes
Question 2
Can we test range 5 to 7 or 8 to 10 using a switch statement in C Programming ?
A
No
B
Yes
Question 2 Explanation: 
We can test it like this -
switch(choice)
  {
  case 5 :
  case 6 :
  case 7 : 
         printf("Case 5-7");
         break;
  case 8 :
  case 9 :
  case 10: 
         printf("Case 8-10");
         break;
  }
Question 3
A char variable storing either an ASCII character or a Unicode character is allowed inside switch case.
A
False
B
True
Question 3 Explanation: 
Following statements are allowed in switch case -
switch(choice)
  {
  case 'A' : 
         printf("Case A");
         break;
  case 'B': 
         printf("Case B");
         break;
  }
Question 4
We cannot use String in the Switch case as label !
A
False
B
True
Question 5
Which of the following cannot be checked in a switch case statement ?
A
Enum
B
Float
C
Character
D
Integer
There are 5 questions to complete.