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
Is c compiled or interpreted?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What is static volatile in c?
Define recursion in c.
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is pragma c?
What does 3 mean in texting?
What is the purpose of type declarations?
C program to find all possible outcomes of a dice?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is an lvalue in c?
Explain what are binary trees?
What is pass by value in c?
What does. int *x[](); means ?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list