Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / daniel

Indeed the correct answer is 5, 20, 1.
Explanation:
* the value of x is 5 so it will print out 5
* the value of x << 2, x shifted to left 2 times means x multiplied by 2 for 2 times, i.e. 5 * 2 * 2 = 20
* the value of x >> 2, x shifted to right 2 times so the result will be 5 / 2 / 2 = 5 / 4 = 1 (x is an int).

Is This Answer Correct ?    85 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we declare a function inside a function in c?

1023


What does malloc () calloc () realloc () free () do?

1050


What is quick sort in c?

1071


Do array subscripts always start with zero?

1271


Differentiate between functions getch() and getche().

1031


When should you use a type cast?

1109


What are global variables and how do you declare them?

1072


show how link list can be used to repersent the following polynomial i) 5x+2

2274


How will you write a code for accessing the length of an array without assigning it to another variable?

1032


What are runtime error?

1115


How do I convert a string to all upper or lower case?

1093


What are different storage class specifiers in c?

1078


What is echo in c programming?

1003


What is void main () in c?

1183


What should malloc() do?

1149