what is the output of the following program and explain the
answer
#include<stdio.h>
exp()
{
main(5)
}
main(int a)
{
printf("%d",a);
return;
}
Answers were Sorted based on User's Feedback
Answer / yogesh bansal
if we add semicolon after main(5) like ; main(5);
the ouput will be 1.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / narendra vemuri
: error C2065: 'main' : undeclared identifier
: error C2143: syntax error : missing ';' before '}'
: warning C4508: 'exp' : function should return a value;
'void' return type assumed
: error C2373: 'main' : redefinition; different type modifiers
: warning C4508: 'main' : function should return a value;
'void' return type assumed
Error executing cl.exe.
test.exe - 3 error(s), 2 warning(s)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vignesh1988i
first of all this will give an error tat 'exp()' is not declared or it needs a prototype & if the 'exp()' is corrected and ';' is added in calling function of main(5) this will print as 5
Is This Answer Correct ? | 2 Yes | 4 No |
Method Overloading exist in c ?
What is the importance of c in your views?
I have a varargs function which accepts a float parameter?
Can a program have two main functions?
Write down the program to sort the array.
Explain the difference between fopen() and freopen().
write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com
code for find determinent of amatrix
write a program to print %d ?
How do I create a directory? How do I remove a directory (and its contents)?
Explain is it valid to address one element beyond the end of an array?
What is the output of below code? main() { static in a=5; printf("%3d",a--); if(a) main(); }