Welcome Guest | Sign in | Register
Functions - Discussion Page For Q.10730 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Functions > Questions and Answers

Q: What is the output of the following code?
main()
{
show();
}
void show()
{
printf("I'm the greatest");
}
A. I'm the greatest B. Compiler error: Type mismatch in re-declaration of show.
C. null D. None of these

Answer and Explanation

Answer:Compiler error: Type mismatch in re-declaration of show.

Explanation:
When the compiler sees the function show it doesn't know anything about it. So the default return type (i.e. int) is assumed. But when compiler sees the actual definition of show mismatch occurs since it is declared as void. Hence it gives compiler error.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.