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



what is the output of the following program and explain the answer #include<stdio.h> exp() ..

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

what is the output of the following program and explain the answer #include<stdio.h> exp() ..

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

what is the output of the following program and explain the answer #include<stdio.h> exp() ..

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

Post New Answer

More C Interview Questions

How many bytes is a struct in c?

0 Answers  


What is nested structure with example?

0 Answers  


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


Is Exception handling possible in c language?

0 Answers   Wipro,


How do I copy files?

0 Answers  


What is an object?

5 Answers  


What is a memory leak? How to avoid it?

1 Answers  


Subtract Two Number Without Using Subtraction Operator

0 Answers  


what is the difference between structure and union?

3 Answers  


main is a predefined or user define function if user defined why? if predefined whay?

12 Answers   TCS,


What is the difference between array_name and &array_name?

0 Answers  


difference between object file and executable file

0 Answers  


Categories