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 a=5;
printf(?%d,%d,%d\n?,a,a< <2,a>>2);
}
Answer: 5,20,1 please explain this code in detail

Answer Posted / neha tibrewal ritm jaipur

firstly value of a is printed. value of a=5, so 5 is printed.
Now, a<<2 means 5<<2 i.e 5 is left shifted by 2.
in binary 5= 101
101<<2= 10100 and decimal value of 10100=20.
so, a<<2=20.
again, a>>2 means 5>>2 i.e 5 is right shifted by 2.
101>>2= 001 and decimal value of 1=1.
so, a>>2=1.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can static variables be declared in a header file?

999


Explain what is the difference between null and nul?

1080


What is auto keyword in c?

1157


Explain how can I make sure that my program is the only one accessing a file?

1161


What is selection sort in c?

1012


What is size of union in c?

974


Write a program on swapping (100, 50)

1061


What language is windows 1.0 written?

985


What is the concatenation operator?

1086


What is optimization in c?

945


writ a program to compare using strcmp VIVA and viva with its output.

1974


Explain output of printf("Hello World"-'A'+'B'); ?

1429


If errno contains a nonzero number, is there an error?

1288


What is s or c?

1006


How do you determine the length of a string value that was stored in a variable?

1078