C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

C Programming Multiple Choice Questions (MCQ)

C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 14



Share with a Friend

Multiple Choice Questions


C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 14

66. What is the output of C Program ?
int main()
{
    int a=5, b=8;
    
    if( a==5 && (b=9) )
    {
        printf("Gorilla Glass=");
    }
    printf("%d %d", a, b);

    return 0;
}
A). 5 8
B). 5 9
C). Gorilla Glass=5 8
D). Gorilla Glass=5 9
View Answer
Correct: D




67. What is the output?
void main()
  {
     int x = 0;
     if (x == 0)
        printf("hi");
     else
        printf("how are u");
     printf("hello");
  }
A). hi
B). how are you
C). hello
D). hihello
View Answer
Correct: D




68. What is the output of C Program ?
int main()
{
    int a=5, b=8;
    
    if( a==5 || (b=9) )
    {
        printf("Gorilla Glass=");
    }
    printf("%d %d", a, b);

    return 0;
}
A). 5 8
B). 5 9
C). Gorilla Glass=5 8
D). Gorilla Glass=5 9
View Answer
Correct: C




69. What is the output?
void main()
{
   int ch;
   printf("enter a value between 1 to 2:");
   scanf("%d", &ch);
   switch (ch)
     {
       case 1:
       printf("1\n");

       printf("2\n");
     }
}
//1 is input
A). 1
B). 1 2
C). 2
D). Error
View Answer
Correct: B




70. Choose a correct 'C' Statement.

A) Nesting of ? : operator is possible.
B)
int main()
{
    int a=5, b=8;
    
    if( a>=5 || (b=9) )
    {
        printf("Gorilla Glass");
    }

    return 0;
}
//OUTPUT: Gorilla Glass

C)
int main()
{
    int a=5, b=8;
    
    if( a >= 5 && b <= 9 )
    {
        printf("Gorilla Glass");
    }

    return 0;
}
//OUTPUT: Gorilla Glass

D) All the above
View Answer
Correct: D