Q. Choose a correct statement about C language break; statement.

  • (A) A single break; statement can force execution control to come out of only one loop.
  • (B) A single break; statement can force execution control to come out of a maximum of two nested loops.
  • (C) A single break; statement can force execution control to come out of a maximum of three nested loops.
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) A single break; statement can force execution control to come out of only one loop.

Q. Choose a correct C Statement regarding for loop.

Code:
for(; ;);
  • (A) for loop works exactly first time
  • (B) for loop works infinite number of times
  • (C) Compiler error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) for loop works infinite number of times

Q. What is the output of C Program?

Code:
int main()
{
    int a=10, b, c;
    b=a++;
    c=++a;
    printf("%d %d %d", a, b, c);

    return 0;
}
  • (A) 10 11 12
  • (B) 12 10 12
  • (C) 12 11 12
  • (D) 12 12 12
πŸ’¬ Discuss
βœ… Correct Answer: (B) 12 10 12

Q. What is the output of C Program.?

Code:
int main()
{
    int a=0, b=0;
    while(++a < 4)
        printf("%d ", a);

    while(b++ < 4)
        printf("%d ", b);

    return 0;
}
  • (A) 0 1 2 3 1 2 3 4
  • (B) 1 2 3 1 2 3 4
  • (C) 1 2 3 4 1 2 3 4
  • (D) 1 2 3 4 0 1 2 3
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1 2 3 1 2 3 4

Q. Expand or Abbreviate ASCII with regard to C Language.

  • (A) Australian Standard Code for Information Interchange
  • (B) American Standard Code for Information Interchange
  • (C) American Symbolic Code for Information Interchange
  • (D) Australian Symbolic Code for Information Interchange
πŸ’¬ Discuss
βœ… Correct Answer: (B) American Standard Code for Information Interchange

Q. What is the output of C Program with Switch Statement.?

Code:
int main()
{
    
    int a=5;
    
    switch(a)
    {
        case 0: printf("0 ");
        case 3: printf("3 ");
        case 5: printf("5 ");
        default: printf("RABBIT ");
    }
       
    a=10;
    switch(a)
    {
        case 0: printf("0 ");
        case 3: printf("3 ");
        case 5: printf("5 ");
        default: printf("RABBIT "); break;
    }
    
    return 0;
}
  • (A) 5 RABBIT
  • (B) 0 3 5 RABBIT 0 3 5 RABBIT
  • (C) 0 3 5 RABBIT RABBIT
  • (D) 3 5 RABBIT RABBIT
πŸ’¬ Discuss
βœ… Correct Answer: (D) 3 5 RABBIT RABBIT

Q. What is the output of C Program with switch statement.?

Code:
int main()
{
    int a=3;
    
    switch(a)
    {
        case 2: printf("ZERO "); break;

        case default: printf("RABBIT ");
    }
    
}
  • (A) RABBIT
  • (B) ZERO RABBIT
  • (C) No output
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the output of C Program with switch statement or block.?

Code:
int main()
{
    int a=3;
    
    switch(a)
    {

    }
    
    printf("MySwitch");
}
  • (A) MySwitch
  • (B) No Output
  • (C) Compiler Error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) MySwitch

Q. What is the output of C Program with switch statement or block.?

Code:
int main()
{
    int a;
    
    switch(a)
    {
        printf("APACHE ");
    }
    
    printf("HEROHONDA");
}
  • (A) APACHE HEROHONDA
  • (B) HEROHONDA
  • (C) No Output
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) HEROHONDA

Q. What is the output of C program with switch statement or block.?

Code:
int main()
{
    int a;
    
    switch(a);
    {
        printf("DEER ");
    }
    
    printf("LION");
}
  • (A) LION
  • (B) DEER LION
  • (C) Compiler error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) DEER LION