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

f=(x>y)?x:y a) f points to max of x and y b) f points to min of x and y c)error

4 Answers   HCL,


what is meant by the "equivalence of pointers and arrays" in C?

3 Answers   Satyam,


how to use enum datatype?Please explain me?

3 Answers   Excel,


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

0 Answers   Case, IBM,


What is the difference between class and object in c?

0 Answers  






How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)

1 Answers   iLantus, Subex,


What does calloc stand for?

0 Answers  


what does ‘segmentation violation’ mean?

1 Answers  


Write a c program using for loop to print typical pattern if number of rows is entered by keyboard. ABCBA AB BA A A

1 Answers  


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

0 Answers   Google, Infosys,


Identify the operators that is not used with pointer a. && b. # c. * d. >>

2 Answers  


if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?

9 Answers   Wipro,


Categories