main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
Answer Posted / anand h i
in printf functiton evaluation of variables start from
right to left so first it evaluates
x>>2
101 after right shift of 2 it will be 001=1
next it will evaluate
x<<2
1 after left shift of 2 it will be 100=4
at the last x=4
so answer is 4 4 1
| Is This Answer Correct ? | 3 Yes | 13 No |
Post New Answer View All Answers
What is the collection of communication lines and routers called?
Explain why c is faster than c++?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is variable in c example?
What are bitwise shift operators in c programming?
What is floating point constants?
How was c created?
Why do we need functions in c?
How do you view the path?
Why do we need a structure?
What is difference between structure and union in c programming?
What are the salient features of c languages?
Explain how do you list a file’s date and time?
Explain how can I manipulate strings of multibyte characters?