• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Quiz - 103

Question 1

For a given integer, which of the following operators can be used to “set” and “reset” a particular bit respectively?
  • | and &
  • && and ||
  • & and |
  • || and &&

Question 2

What’s going to happen when we compile and run the following C program snippet? C
#include \"stdio.h\"
int main()
{
 int a = 10;
 int b = 15;

 printf(\"=%d\",(a+1),(b=a+2));
 printf(\" %d=\",b);

 return 0;
}
  • =11 15=
  • =11 12=
  • Compiler Error due to (b=a+2) in the first printf().
  • No compile error but output would be =11 X= where X would depend on compiler implementation.

Question 3

What’s going to happen when we compile and run the following C program snippet? C
#include \"stdio.h\"
int main()
{
 int a = 10;

 printf(\"=%d %d=\",(a+1));

 return 0;
}
  • =11 0=
  • =11 X= where X would depend on Compiler implementation
  • Undefined behavior
  • Compiler Error due to missing argument for second %d

Question 4

Which of the following functions from “stdio.h” can be used in place of printf()?
  • fputs() with FILE stream as stdout.
  • fprintf() with FILE stream as stdout.
  • fwrite() with FILE stream as stdout.
  • All of the above three - a, b and c.
  • In “stdio.h”, there’s no other equivalent function of printf().

Question 5

As per C language standard, which of the followings is/are not keyword(s)? Pick the best statement. auto make main sizeof elseif

  • sizeof elseif make

  • make main elseif

  • make main

  • auto make

  • None of the above is keywords in C.

There are 5 questions to complete.

Last Updated :
Take a part in the ongoing discussion