VOOZH about

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

⇱ Quiz about C Quiz - 109


Last Updated :
Discuss
Comments

Question 1

In the following program snippet, both s1 and s2 would be variables of structure type defined as below and there won't be any compilation issue.

  • Both s1 and s2 are valid variables of the same structure type, and the code compiles without any error

  • s1 is valid, but s2 causes a compilation error because the struct tag name and typedef name cannot be the same.

  • s2 is valid, but s1 causes a compilation error because Student can only be used with the struct keyword

  • The code compiles, but s1 and s2 are of different types because typedef creates a new unrelated type.

Question 2

Find out the correct statement for the following program.
  • Compile Error
  • It’ll always print Equal.
  • It’ll always print Not Equal.
  • Since elements of arrPtr aren’t initialized in the program, it’ll print either Equal or Not Equal.

Question 3

Pick the best statement for the following program.
  • It’ll result in compile error because foo is used without parentheses.
  • No compile error and some garbage value would be passed to foo function. This would make foo to be executed with output “garbage integer”.
  • No compile error but foo function wouldn’t be executed. The program wouldn\'t print anything.
  • No compile error and ZERO (i.e. 0) would be passed to foo function. This would make foo to be executed with output 0.

Question 4

Find out the correct statement for the following program.
  • Line with comment (1) will give compile error.
  • Line with comment (2) will give compile error.
  • Lines with (1) & (3) will give compile error.
  • Lines with (2) & (4) will give compile error.
  • No compile error and program will run without any issue.

Question 5

Find out the correct statement for the following program.
  • It’ll always print Equal.
  • It’ll always print Not Equal.
  • Since gPtr isn’t initialized in the program, it’ll print sometimes Equal and at other times Not Equal.
Tags:

There are 5 questions to complete.

Take a part in the ongoing discussion