What is the output of following program ?
int
main()
{
int x = 5;
printf("%d %d %d\n", x, x << 2, x >> 2);
}
Answer Posted / krishna deep sharma
4,4,1
coz we shift the bit as 5=101 now shift two bit to right as
101>>2=001
now
2<<001=100
noe x=4
printf execute from right to left so ans is 4,4,1
| Is This Answer Correct ? | 11 Yes | 28 No |
Post New Answer View All Answers
What is restrict keyword in c?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Describe wild pointers in c?
Give the rules for variable declaration?
Is r written in c?
How many levels of pointers can you have?
What is the advantage of a random access file?
Can we change the value of constant variable in c?
Write a code to generate divisors of an integer?
I need testPalindrome and removeSpace
#include
What is bubble sort in c?
What is the difference between printf and scanf in c?
Explain what is a stream?
What happens if a header file is included twice?
What is the scope of static variable in c?