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 10



Share with a Friend

Multiple Choice Questions


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

46. What is the output of C Program ?
int main()
{
    int a=9;
    if(a==5);
    {
        printf("Duck\n");
    }
    printf("Eggs\n");

    return 0;
}
A). Eggs
B). Duck Eggs
C). No output
D). Compiler error
View Answer
Correct: B




47. The CONTINUE statemment cannot be used with
A). for
B). switch
C). do
D). while
View Answer
Correct: B




48. What is the output of C Program ?
int main()
{
    int a=9;
    if(a==9);
    {
        printf("Swan\n");
    }
    elseif(a==8)
    {
        printf("Eggs\n");
    }
    
    printf("Red");

    return 0;
}
A). Red
B). Swan Red
C). No Ouput
D). Compiler error
View Answer
Correct: D




49. Study the following ā€˜C’ program
#include 
void main ()
{ 
    int a = 7, b = 5;
    switch (a/a % b)
    { 
         case 1 : a = a-b;
         case 2 : a = a+b;
         case 3 : a = a*b;
         case 4 : a = a/b;
         default : a = a;
    } 
}
One the execution of above program, what will be the variable a?
A). 2
B). 5
C). 7
D). 12
View Answer
Correct: D




50. What is the output of C Program ?
int main()
{
    int a=9;
    if(a==9)
    {
        printf("Swan\n");
    }
    else;
    {
        printf("Eggs\n");
    }
    
    printf("Red");

    return 0;
}
A). Red
B). Swan Red
C). Swan Eggs Red
D). Compiler Error
View Answer
Correct: C