VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/c-quiz-104-gq/

⇱ Quiz about C Quiz - 104


Last Updated :
Discuss
Comments

Question 1

With respect to following “for” loops in C, pick the best statement Assume that there is a prior declaration of 'i' in all cases
  • All the above “for” loops would compile successfully.
  • All the above “for” loops would compile successfully. Except (iii), the behaviour of all the other “for” loops depend on compiler implementation.
  • Only (iii) would compile successfully.
  • Only (iii) and (iv) would compile successfully.
  • Only (iii) and (iv) would compile successfully but behaviour of (iv) would depend on compiler implementation.

Question 2

With respect to following “for” loops in C, pick the best statement. Assume that there is a prior declaration of 'i' in all cases
  • Only (i) and (v) would compile successfully. Also (v) can be used as infinite loop.
  • Only (i) would compile successfully.
  • All would compile successfully but behavior of (ii), (iii) and (iv) would depend on compiler.
  • All would compile successfully.

Question 3

What’s going to happen when we compile and run the following C program?


  • Compile Error.

  • No compile error but it will run into infinite loop printing GeeksQuiz.

  • No compile error and it’ll print GeeksQuiz 10 times.

  • No compile error but it’ll print GeeksQuiz 9 times.

Question 4

What’s going to happen when we compile and run the following C program?


  • Compile Error due to use of continue in for loop.

  • No compile error but it will run into infinite loop printing Geeks.

  • No compile error and it’ll print GeeksQuiz 10 times followed by Quiz once.

  • No compile error and it’ll print GeeksQuiz 10 times.

Question 5

Which of the following statement is correct for switch controlling expression?

  • Only int can be used in “switch” control expression.
  • Both int and char can be used in “switch” control expression.
  • All types i.e. int, char and float can be used in “switch” control expression.
  • “switch” control expression can be empty as well.
Tags:

There are 5 questions to complete.

Take a part in the ongoing discussion