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 6



Share with a Friend

Multiple Choice Questions


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

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

    return 0;
}
A). Yes
B). Hurray.. Yes
C). Hurray..Yes
D). No Output
View Answer
Correct: A




27. Which for loop has range of similar indexes of ā€˜i’ used in
for (i = 0;i < n; i++)?

A). for (i = n; i>0; i--)
B). for (i = n; i >= 0; i--)
C). for (i = n-1; i>0; i--)
D). for (i = n-1; i>-1; i--)
View Answer
Correct: D




28. What is the output of the C Program ?
int main()
{
    if( 4 < 5 )
        printf("Hurray..\n");
        printf("Yes");
    else
        printf("Lucknow")


    return 0;
}
A). Hurray..Yes
B). Hurray.. Yes
C). Compiler error
D). None of the above
View Answer
Correct: C




29. What is the output?
void main()
{
   int k;
   for (k = -3; k < -5; k++)
   printf("Hello");
}
A). Hello
B). Infinite Hello
C). Error
D). Blank
View Answer
Correct: D




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


    return 0;
}
A). France
B). Hurray..
C). Compiler error for missing else
D). None of the above
View Answer
Correct: A