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


Please Help Members By Posting Answers For Below Questions

How can I pad a string to a known length?

697


What do you mean by dynamic memory allocation in c?

733


Explain indirection?

740


What is file in c language?

672


Can a void pointer point to a function?

661






What is 2c dna?

699


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1709


What is difference between stdio h and conio h?

999


How can variables be characterized?

1783


What is a keyword?

856


What is keyword with example?

731


Why is c used in embedded systems?

712


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1618


if p is a string contained in a string?

1499


What is calloc()?

711