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

What is a keyword?

0 Answers  


what is the difference between. system call and library function?

2 Answers   CDAC, Satyam,


ABCDCBA ABC CBA AB BA A A

4 Answers   TCS,


what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsigned int i = 0; while (i < 10) v[i] = i++;

2 Answers   Google,


What is a built-in function in C?

1 Answers  






Differentiate between calloc and malloc.

0 Answers   Wipro,


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers   Calsoft,


What is a structural principle?

0 Answers  


why the execution starts from main function

9 Answers  


What is openmp in c?

0 Answers  


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

0 Answers  


What is malloc return c?

0 Answers  


Categories