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

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

Instructions

Total Questions: 20

Total Minutes: 20

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 / 20

Take This Exam
1) Choose a C Conditional Operator from the list.
2) What is the other name for C Language ?: Question Mark Colon Operator.?
3) Choose a syntax for C Ternary Operator from the list.
4) What is the output of the C statement.?
int main()
{
    int a=0;
    a = 5<2 ? 4 : 3;
    printf("%d",a);

    return 0;
}
5) What is the output of C Program.?
int main()
{
    int a=0;
    a = printf("4");
    printf("%d",a);

    return 0;
}
6) What is the output of the C Program.?
int main()
{
    int a=0;
    a = 5>2 ? printf("4"): 3;
    printf("%d",a);

    return 0;
}
7) What is the output of the C Program.?
int main()
{
    int a=0;
    a = (5>2) ? : 8;
    printf("%d",a);

    return 0;
}
8) What is the output of C Program.?
int main()
{
    int a=0, b;
    a = (5>2) ? b=6: b=8;
    printf("%d %d",a, b);

    return 0;
}
9) Choose a correct statement regarding C Comparison Operators.
10) Choose a statement to use C If Else statement.
11) Choose a correct C Statement using IF Conditional Statement.
12) What is the output of the C Program.?
int main()
{
    if( 4 > 5 )
    {
        printf("Hurray..\n");
    }
     printf("Yes");

    return 0;
}
13) What is the output of the C Program.?
int main()
{
    if( 4 > 5 )
        printf("Hurray..\n");
        printf("Yes");

    return 0;
}
14) What is the output of the C Program.?
int main()
{
    if( 4 < 5 )
        printf("Hurray..\n");
        printf("Yes");
    else
        printf("England")

    return 0;
}
15) What is the output of the C Program.?
int main()
{
    if( 10 < 9 )
        printf("Hurray..\n");
    else if(4 > 2)
        printf("England");

    return 0;
}
16) What is the output of C Program.?
int main()
{
    if( 10 > 9 )
        printf("Singapore\n");
    else if(4%2 == 0)
        printf("England\n");
        printf("Poland");
    return 0;
}
17) What is the output of the C Program.?
int main()
{
    if(-5)
    {
        printf("Germany\n");
    }
    if(5)
    {
        printf("Texas\n");
    }
    printf("ZING");

    return 0;
}
18) What is the output of the C Program.?
int main()
{
    if(10.0)
    {
        printf("Texas\n");
    }
    printf("ZING");

    return 0;
}
19) What is the output of C Program.?
int main()
{
    if("abc")
    {
        printf("India\n");
    }
    if('c')
    {
        printf("Honey\n");
    }
    printf("ZING");

    return 0;
}
20) What is the output of C Program.?
int main()
{
    if(TRUE)
    {
        printf("India\n");
    }
    if(true)
    {
        printf("Honey\n");
    }
    printf("ZING");

    return 0;
}
Certification Group ID
3858

Open Certification Helper Popup Reset Popup