C - Functions - Discussion

You Are Here :: Home > C > Functions - Discussion

 



Q.

main()
{
show();
}
void show()
{
printf("I'm the greatest");
}

A. i m the greatest B. 0
C. Runtime error D. Compiletime error

Answer: Option D
Explaination:

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



Discussion

Your Comments Goes here...
NameDiscussion