TOTAL QS = 15Time [ 00 : 00 : 00 ]
00:00:00

C Programming Basics Tutorial - Conditional Statements Operators - Online Test 2

Instructions

Total Questions: 15

Total Minutes: 15

This ExamTray Free Online Exam tests your C Programming Skills on C Conditional Statements or Operators like If, else if and else, Ternary Question Mark Operator. Exam displays Questions and Answers after finishing. Easily Attend Competitive Exams and Job Interview Questions.

Go through C Theory Notes on Conditional Operators before attempting this test.

All the Best

Challenge SCORE

0 / 15

Take This Exam
1) What is the output of C Program.?
int main()
{
    int x=1;
    float y = 1.0;
    if(x == y)
    {
        printf("Polo\n");
    }
    if( 1 == 1.0)
    {
        printf("Golf\n");
    }

    if( 1.0 == 1.0f )
    {
         printf("Boxing\n");
    }
    return 0;
}
2) What is the output of C Program.?
int main()
{
    int a=9;
    if(a=8)
    {
        printf("Kangaroo\n");
    }
    printf("Eggs\n");

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

    return 0;
}
4) What is the output of C Program.?
int main()
{
    int a=9;
    if(a==9);
    {
        printf("Ostrich\n");
    }
    elseif(a==8)
    {
        printf("Eggs\n");
    }
    
    printf("White");

    return 0;
}
5) What is the output of C Program.?
int main()
{
    int a=9;
    if(a==9)
    {
        printf("Ostrich\n");
    }
    else;
    {
        printf("Eggs\n");
    }
    
    printf("White");

    return 0;
}
6) What is the output of C Program.?
int main()
{
    int a=9, b=5, c=8;
    a=b=c=10;
    if(a==9)
    {
        printf("Ostrich\n");
    }
    else
    {
        printf("Eggs\n");
    }
    
    printf("White");

    return 0;
}
7) What is the output of C Program.?
int main()
{
    int a=9, b=5, c=8;

    if(!(a==9))
    {
        printf("Bear\n");
    }
    else
    {
        printf("Elephant\n");
    }
    
    printf("Fox");

    return 0;
}
8) What is the Priority of C Logical Operators.? NOT (!), AND (&&) and OR (||)
9) What is the output of C Program.?
int main()
{
    int a=9, b;
    
    b = (a==9) ? (printf("CAT\n");printf("DOG\n")) : (printf("FOX"));

    return 0;
}
10) What is the output of C Program.?
int main()
{
    int a=9, b=6;
    if(a==9 && b==6)
    {
        printf("Hockey");
    }
    else
    {
        printf("Cricket");
    }
    

    return 0;
}
11) What is the output of C Program.?
int main()
{
    int a=9, b=6;
    if(a!=9 || b==6)
    {
        printf("Hockey\n");
    }
    else
    {
        printf("Cricket\n");
    }
    
    printf("Football");

    return 0;
}
12) Choose a correct C Operator Priority.? Items in one group ( ) has same priority.
13) 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;
}
14) 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;
}
15) Choose a correct C Statement.
Certification Group ID
3858

Open Certification Helper Popup Reset Popup