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
What is use of null pointer in c?
Explain what are linked list?
What functions are in conio h?
Can a file other than a .h file be included with #include?
Write a program to reverse a given number in c language?
Why is struct padding needed?
What are the types of data files?
What is the right way to use errno?
Is it possible to execute code even after the program exits the main() function?
What is volatile c?
Write a program for Overriding.
What is the purpose of type declarations?
What are structure types in C?
What is the use of ?
Where are some collections of useful code fragments and examples?