GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 12 of 87    Print  
what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
a.3
b.1
c.0
d.2
C



  
Total Answers and Comments: 4 Last Update: November 30, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 07, 2005 07:00:06   #1  
avula tirupathi rao        

RE: what does the following function print?func(int i){if(i%2)return 0;eale return 1;}main(){int =3;i=fu...
it will print 1 not 0

 
Is this answer useful? Yes | No
August 23, 2005 03:24:31   #2  
Sinic        

RE: what does the following function print?func(int i){if(i%2)return 0;eale return 1;}main(){int =3;i=fu...
Due to first call i 0 then it is a param for next call which returns i 1

Ans : B

 
Is this answer useful? Yes | No
July 03, 2006 06:27:54   #3  
karna        

RE: what does the following function print?func(in...

hi

when i 3 if(i 2) becomes if(1) so it will return 0

then when i 0 if(i 2) becomes if(0) so it will return 1;

so i 1 the answer is b.


 
Is this answer useful? Yes | No
November 29, 2006 12:34:18   #4  
neelu        

RE: what does the following function print?func(in...

hi

if i 3 then if(i 2) i.e. if(3 2) it returns o;

else

if i 0 then if(i 2) i.e. if(0 2) it returns 1;

the answer is 1 i.e. option (B).


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape