what is output of the following statetment?Printf(“%x”,
-1<<4); ?
Answer Posted / arupananda
Question is -1<<4
Answer to 16bit compiler
As -1 is a negative number,so compiler first convert this number with removing negative sign to 2's complement
Here -1 is given
so compiler first removes the -ve sign and then convert to 2's complement
Binary form of 1 for 16 bit compiler is 0000 0000 0000 0001
1's complement of 1 is 1111 1111 1111 1110
2's complement of 1 is 1111 1111 1111 1111(1+1's complement)
now do the left shift operation
1111 1111 1111 1111 << 4
which results 1111 1111 1111 0000
i.e equivalent to FFF0 in hex format
So the answer is FFF0 for 16 bit compiler
And for 32 bit compiler it is FFFF FFF0 (do same operation as 16 bit compiler)
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Who is the founder of c language?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What are the 4 data types?
What is the use of ?: Operator?
Is Exception handling possible in c language?
How can my program discover the complete pathname to the executable from which it was invoked?
What is n in c?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
How does selection sort work in c?
What is the right type to use for boolean values in c?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
What is the g value paradox?
what are the 10 different models of writing an addition program in C language?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is non linear data structure in c?