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 |
Write a C program to multiply tho numbers without using arithmetic operator (+, -, *, /).
m=++i&&++j(||)k++ printf("%d"i,j,k,m)
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?
How we can write a value to an address using macro..?
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?
write a program in c to print **** * * * * ****
Explain 'bit masking'?
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
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
What are structure types in C?