C Quiz – 110 | Question 4

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”

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


(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



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.