ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
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;
}
 Question Submitted By :: Srilatha_k
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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; }
Answer
# 1
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 ?    1 Yes 1 No
Vignesh1988i
 
  Re: 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; }
Answer
# 2
if we add semicolon after main(5) like ; main(5);

the ouput will be 1.
 
Is This Answer Correct ?    1 Yes 1 No
Yogesh Bansal
 
 
 
  Re: 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; }
Answer
# 3
: 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
Narendra Vemuri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?  2
study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)++; printf("a=%dn(*p)=%dn",a,*p); } What is printed? A)100,101 B)100,100 C)101,101 D)None of the above Accenture13
User define function contain thier own address or not.  2
what is diff between localstatic and globalstatis variable possible 2 use in another file...? HCL2
What is encapsulation?  1
why the execution starts from main function  9
what is the use of a array in c  4
Can we write a program without main() function?  9
How do you write a program which produces its own source code as its output?  3
what are brk, sbrk? Oracle1
Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks. Google3
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?  5
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME5
What is the diffences between Windows XP and Windows Visa Aricent1
Why preprocessor should come before source code?  2
what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green") Cadence4
how to copy a string without using c function  5
Dear Sir, we are required the bubble sorting programs Regs Prem  1
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe  2
write a program to swap Two numbers without using temp variable. HP22
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com