main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
Answer Posted / daniel
Indeed the correct answer is 5, 20, 1.
Explanation:
* the value of x is 5 so it will print out 5
* the value of x << 2, x shifted to left 2 times means x multiplied by 2 for 2 times, i.e. 5 * 2 * 2 = 20
* the value of x >> 2, x shifted to right 2 times so the result will be 5 / 2 / 2 = 5 / 4 = 1 (x is an int).
Is This Answer Correct ? | 84 Yes | 2 No |
Post New Answer View All Answers
What is memcpy() function?
What is switch in c?
Explain the difference between #include "..." And #include <...> In c?
What are the application of void data type in c?
What is the use of parallelize in spark?
What is getch c?
Is fortran still used in 2018?
What are the advantages and disadvantages of c language?
Explain how can I open a file so that other programs can update it at the same time?
What is the return type of sizeof?
What is #include called?
What is omp_num_threads?
What is hash table in c?
Describe the header file and its usage in c programming?
How do you sort filenames in a directory?