read the folllowing 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 vlaue after
executing this code?
a.200
b.1
c.-1
d.50

Answers were Sorted based on User's Feedback



read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX..

Answer / divakar

50. irrespective of the if and else if at last ur assigning
x=50

Is This Answer Correct ?    24 Yes 2 No

read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX..

Answer / fazlur rahaman naik

the right answer is d.

Is This Answer Correct ?    14 Yes 6 No

read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX..

Answer / nila

the right answer is x=50,why?.if condition is true
and then after checking if condition x is assigned a value
of 50.so the final answer is 50.

Is This Answer Correct ?    5 Yes 0 No

read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX..

Answer / manishsoni

it will print 50 because:
if(200>100)//condition true;
then x=1
and show in memory like this
___ ____
| | | |
x | 1 | then replace x| 50 |
|___| with |____|
100 100
so print the 50 value.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Interview Questions

The differences between Windows XP and Windows Visa

8 Answers   HCL,


Explain what is wrong in this statement?

0 Answers  


What is string function in c?

0 Answers  


What is an expression?

0 Answers  


what is an inline fuction??

2 Answers  


How to explain the final year project as a fresher please answer with sample project

0 Answers  


What is the output of the following progarm? #include<stdio.h> main( ) { int x,y=10; x=4; y=fact(x); printf(“%d\n”,y); } unsigned int fact(int x) { return(x*fact(x-1)); } A. 24 B. 10 C. 4 D. none

2 Answers  


What is the difference between NULL and NUL?

0 Answers   Aspire, Infogain,


Write code for initializing one dimentional and two dimentional array in a C Program?

5 Answers   Deshaw, Edutech, GMD,


which type of question asked from c / c++ in interview.

2 Answers  


who is the editor of 'pokemon'?

1 Answers  


List some applications of c programming language?

0 Answers  


Categories