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

C Programming Data Types and Storage Classes Online Test 1

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.

All the Best

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.