main()
{
int a=5;
printf(?%d,%d,%d\n?,a,a< <2,a>>2);
}
Answer: 5,20,1 please explain this code in detail
Answer Posted / neha tibrewal ritm jaipur
firstly value of a is printed. value of a=5, so 5 is printed.
Now, a<<2 means 5<<2 i.e 5 is left shifted by 2.
in binary 5= 101
101<<2= 10100 and decimal value of 10100=20.
so, a<<2=20.
again, a>>2 means 5>>2 i.e 5 is right shifted by 2.
101>>2= 001 and decimal value of 1=1.
so, a>>2=1.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Explain how can a program be made to print the name of a source file where an error occurs?
How will you delete a node in DLL?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
What is the sizeof () operator?
Tell me about low level programming languages.
a c code by using memory allocation for add ,multiply of sprase matrixes
What is the explanation for modular programming?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is the scope of global variable in c?
Why can't I perform arithmetic on a void* pointer?
How does sizeof know array size?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is the explanation for prototype function in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f