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 ? | 85 Yes | 2 No |
Post New Answer View All Answers
Can we declare a function inside a function in c?
What does malloc () calloc () realloc () free () do?
What is quick sort in c?
Do array subscripts always start with zero?
Differentiate between functions getch() and getche().
When should you use a type cast?
What are global variables and how do you declare them?
show how link list can be used to repersent the following polynomial i) 5x+2
How will you write a code for accessing the length of an array without assigning it to another variable?
What are runtime error?
How do I convert a string to all upper or lower case?
What are different storage class specifiers in c?
What is echo in c programming?
What is void main () in c?
What should malloc() do?