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 / saikumar
main()
{
int a=5;
printf("%d,%d,%d\n",a,a<<5,a>>2);
}
explanation:in the above program already we assinged a value is 5.
in the printf statement a is 5
and a<<2 it means 'a' leftshift 2 it should converted in to binary form .first we take 5 is in the binary form is 101.
and next we take 2 is in the binary form 010.
we have to shift the 5 to left side of 2 terms .
101<<010=10100=20.
101>>010=001=1.
output:
5
20
1
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain how can I write functions that take a variable number of arguments?
What happens if header file is included twice?
What is the best way to store flag values in a program?
What is a far pointer in c?
What is c programing language?
How can I run c program?
What is restrict keyword in c?
Explain what is output redirection?
What is the significance of scope resolution operator?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Can an array be an Ivalue?
What is header file definition?
i got 75% in all semester am i eligible for your company
Is it possible to initialize a variable at the time it was declared?
Explain 'far' and 'near' pointers in c.