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 |
Is it fine to write void main () or main () in c?
What is the difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
Why shouldn’t I start variable names with underscores?
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student"
write a c program to find the probability of random numbers between 1-1000
Write the test cases for checking a variable having value in range -10.0 to +10.0?
what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question
write a function for strtok()??
write a code for large nos multilication (upto 200 digits)
What is bin sh c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10