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 |
Write a program to swap two numbers without using a temporary variable?
write a program to display numbers from 1 to 10 and 10 to 1?
What is the difference between pure virtual function and virtual function?
Why doesn't C support function overloading?
Can true be a variable name in c?
Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types?
What is a const pointer?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
accept character from keyboard untill the user presses the enter key.If the user enters any character other than upper case(A-Z)alphabets program should stop taking any input
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
2 Answers Scientific Atlanta, Wipro,
What is pass by value in c?
Write a program to use switch statement.
0 Answers Agilent, Integreon, ZS Associates,