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

What is an example of structure?

1102


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1137


What is difference between array and pointer in c?

1144


Explain the bubble sort algorithm.

1113


What is the correct code to have following output in c using nested for loop?

1123


What is pragma c?

1185


What is the translation phases used in c language?

1174


Is c call by value?

1080


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

2142


write a program to create a sparse matrix using dynamic memory allocation.

4958


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1547


Explain the advantages and disadvantages of macros.

1143


How can I find out if there are characters available for reading?

1167


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

3125


Between macros and functions,which is better to use and why?

2323