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
Answer / divakar
50. irrespective of the if and else if at last ur assigning
x=50
| Is This Answer Correct ? | 24 Yes | 2 No |
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 |
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 |
How can I manipulate individual bits?
sum of two integers values only other then integer it should print invalid input.
Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?
2 Answers ME, Synfusion, Wipro,
Identify the operators that is not used with pointer a. && b. # c. * d. >>
how the size of an integer is decided? - is it based on processor or compiler or OS?
19 Answers HCL, JPR, Microsoft, nvidia,
In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?
What is the difference between far and near in c?
Program to swap the any two elements in an array containing N number of elements?
1 Answers Bosch, Glenwood, Ugam Solutions,
Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..???
what is the difference between i++ and ++i?
x=y=z=1 z=++x||++y&&++z Printf("%%%d";xyz) what is the values of x,y and z?????
Write a program to check palindrome number in c programming?