Skip to content
Related Articles

Related Articles

C Quiz – 110 | Question 4
  • Difficulty Level : Basic
  • Last Updated : 24 Oct, 2015
GeeksforGeeks - Summer Carnival Banner

The below program would give compile error because comma has been used after foo(). Instead, semi-colon should be used i.e. the way it has been used after bar().

That’s why if we use semi-colon after foo(), the program would compile and run successfully while printing “GeeksQuiz”




#include "stdio.h"
  
void foo(void)
{
 printf("Geeks");
}
void bar(void)
{
 printf("Quiz");
}
  
int main()
{
 foo(), bar();
 return 0;
}

(A) TRUE
(B) FALSE


Answer: (B)

Explanation: Here, comma is acting as an operator instead of separator. For a comma operator in C, first left operand is evaluated and then right operand is evaluated. That’s why foo() would be called followed by bar(). There’s no issue with the given program. It’ll compile and print “GeeksQuiz” without any modification itself.

Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :