GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 50 of 87    Print  
Read the following code
# define MAX 100
# define MIN 100
        ....
        ....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the value after executing this code?

A. 200
B. 1
C. -1
D. 50


  
Total Answers and Comments: 4 Last Update: June 02, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 17, 2005 07:41:02   #1  
mehul        

RE: Read the following code# define MAX 100# define MIN 100        .....
how can i know about open interview of TCS?
Please send me ans on my email

 
Is this answer useful? Yes | No
April 17, 2006 05:39:36   #2  
priya        

RE: Read the following code# define MAX 100#...

hi all

ans is-50

because of value of x change to 50 after evaluating the value


 
Is this answer useful? Yes | No
March 14, 2007 08:05:47   #3  
prakash        

RE: Read the following code# define MAX 100#...

Ans C
Because the initial value of x is 200 so first execute the if condition (x>max)
Then the condition is satisfied the ans x 1


 
Is this answer useful? Yes | No
June 02, 2008 16:38:07   #4  
anu1985 Member Since: May 2008   Contribution: 11    

RE: Read the following code# define MAX 100# define MIN 100        ....        ....if(x>MAX)x=1;else if(x<MIN)x=-1;x=50;if the initial value of x=200,what is the value after execu
the value of x will be 50
 
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