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 16



Share with a Friend

Multiple Choice Questions


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

76. Which loop is faster in C Language, for, while or Do While ?
A). for
B). while
C). do while
D). All work at same speed
View Answer
Correct: D




77. What is the output of the following code:
void main()
  {
    int i;
    for ( i=65; i<70; i++ )
       printf("%c," ,i);
  }
A). 65,66,67,68,69,70
B). a,b,c,d,e,
C). A,B,C,D,E,
D). A,B,C,D,E
View Answer
Correct: C




78. Choose correct C while loop syntax.
A)
while(condition)
{
    //statements
}

B)
{
    //statements
}while(condition)

C)
while(condition);
{
    //statements
}

D)
while()
{
    if(condition)
    {
        //statements
    }
}
View Answer
Correct: A




79. How many times the following code prints the string “hello”
  for ( i=1; i<=50; i++ )
    printf ("Hello");
A). 1
B). 50
C). Zero
D). None of them
View Answer
Correct: B




80. Choose a correct C for loop syntax.
A)
for(initalization; condition; incrementoperation)
{
    //statements
}

B)
for(declaration; condition; incrementoperation)
{
    //statements
}

C)
for(declaration; incrementoperation; condition)
{
    //statements
}

D)
for(initalization; condition; incrementoperation;)
{
    //statements
}

View Answer
Correct: A