Question
Point out the error in the program
#include<stdio.h>
int main()
{
int a=10;
void f();
a = f();
printf("%dn", a);
return 0;
}
void f()
{
printf("Hi");
}
Answer: Option A
Was this answer helpful ?
The function void f() is not visible to the compiler while going through main() function. So we have to declare this prototype void f(); before to main() function. This kind of error will not occur in modern compilers.
Was this answer helpful ?
Submit Solution