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 echo in c programming?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
How can I determine whether a machines byte order is big-endian or little-endian?
What are qualifiers in c?
What are the uses of a pointer?
What is the purpose of void pointer?
Why is it that not all header files are declared in every C program?
Explain setjmp()?
Explain the Difference between the New and Malloc keyword.
What is a good data structure to use for storing lines of text?
What is the size of enum in bytes?
What is use of #include in c?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Explain the advantages and disadvantages of macros.
What are the 5 data types?