Open In App

C Quiz – 110 | Question 4

Like Article
Like
Save
Share
Report

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


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads