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 |
How many bytes is a struct in c?
What is nested structure with example?
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
Is Exception handling possible in c language?
How do I copy files?
What is an object?
What is a memory leak? How to avoid it?
Subtract Two Number Without Using Subtraction Operator
what is the difference between structure and union?
main is a predefined or user define function if user defined why? if predefined whay?
What is the difference between array_name and &array_name?
difference between object file and executable file