main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}

Answer Posted / anand h i

in printf functiton evaluation of variables start from
right to left so first it evaluates
x>>2
101 after right shift of 2 it will be 001=1
next it will evaluate
x<<2
1 after left shift of 2 it will be 100=4
at the last x=4
so answer is 4 4 1

Is This Answer Correct ?    3 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is malloc calloc and realloc in c?

670


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

1768


What is a program?

665


Can you please explain the difference between syntax vs logical error?

697


What is the -> in c?

583






How do you declare a variable that will hold string values?

670


What is anagram in c?

521


Explain why can’t constant values be used to define an array’s initial size?

854


Why c is faster than c++?

631


Why is c called "mother" language?

855


What is an lvalue?

636


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

631


Why does everyone say not to use gets?

608


Can a variable be both constant and volatile?

561


How can you find out how much memory is available?

618