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
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What are 3 types of structures?
What does the c in ctime mean?
What is the method to save data in stack data structure type?
What are the types of data structures in c?
Explain built-in function?
How can I recover the file name given an open stream?
What are the 3 types of structures?
Why does this code crash?
What is the meaning of && in c?
How do I create a directory? How do I remove a directory (and its contents)?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is a string?
What is the difference between new and malloc functions?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none