Open In App

Algorithms Quiz | SP2 Contest 1 | Question 3

Like Article
Like
Save
Share
Report

What will be the output of the below C program?




#include <stdio.h>
  
int main() 
{
    int a = 2;
      
    if("%d=gfg", a);
  
    return 0;
}


(A) Compilation Error
(B) 2=gfg
(C) No Output
(D) 2


Answer: (C)

Explanation: There is no printf() statement in the above program, so the program will not print any output. Also, the program is syntactically error-free so there is no compilation error.

Quiz of this Question
Please comment below if you find anything wrong in the above post


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