Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is the output of this program?

#include <stdio.h>
int main()
{
  printf("%d",30);
  return 0;
}

 

  • A.Runtime Error
  • B.Garbage value
  • C.Compilation error
  • D.30

Answer: C

Correct answer: 30

There is nothing wrong with the program: <stdio.h> is included, main returns int, and printf("%d", 30) matches its format specifier to an int argument. It compiles cleanly and prints 30.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.