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

Write a C program to multiply tho numbers without using arithmetic operator (+, -, *, /).

1 Answers  


m=++i&&++j(||)k++ printf("%d"i,j,k,m)

1 Answers   ABC,


How to add two numbers without using arithmetic operators?

18 Answers   College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,


What's a good way to check for "close enough" floating-point equality?

0 Answers   Celstream,


How we can write a value to an address using macro..?

0 Answers   Tata Elxsi,






hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

0 Answers   Aegis, CDAC, Infosys,


write a function that accepts an array A with n elements and array B with n-1 elements. Find the missing one in array B,with an optimized manner?

2 Answers   Zensar,


write a program in c to print **** * * * * ****

1 Answers   TCS,


Explain 'bit masking'?

0 Answers   EXL,


What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation

10 Answers   IBM,


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


What are structure types in C?

0 Answers  


Categories