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
Explain void pointer?
How can I remove the leading spaces from a string?
c language interview questions & answer
What are c preprocessors?
What does a function declared as pascal do differently?
Explain how do you convert strings to numbers in c?
What is function prototype in c with example?
What is wrong with this declaration?
What is the meaning of 2d in c?
What is c language in simple words?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What do you mean by dynamic memory allocation in c? What functions are used?
What is a static variable in c?
What is a rvalue?
Can a pointer be volatile in c?