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 third variable in c?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
Explain how do you search data in a data file using random access method?
c program to add and delete an element from circular queue using array
What are the types of variables in c?
Hierarchy decides which operator a) is most important b) is used first c) is fastest d) operates on largest numbers
Do character constants represent numerical values?
Why clrscr is used after variable declaration?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
write a program to sum of its digit with using control structure or with out using loop. for ex: let the number is 25634 then answer will be=2+5+6+3+4=20
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a
Can anyone tell what is stack overflow? what precaution we should take?