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
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
Tell me what is the purpose of 'register' keyword in c language?
What is the use of getchar functions?
Explain what is wrong in this statement?
What is a protocol in c?
where are auto variables stored? What are the characteristics of an auto variable?
What is the use of a conditional inclusion statement in C?
Explain how can I manipulate strings of multibyte characters?
What is data structure in c and its types?
What is calloc in c?
Subtract Two Number Without Using Subtraction Operator
write a program to display all prime numbers
How can I split up a string into whitespace-separated fields?
What is identifiers in c with examples?
What is the role of && operator in a program code?