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

List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2750


What are 3 types of structures?

1072


What does the c in ctime mean?

1100


What is the method to save data in stack data structure type?

1095


What are the types of data structures in c?

1159


Explain built-in function?

1148


How can I recover the file name given an open stream?

1030


What are the 3 types of structures?

1035


Why does this code crash?

1105


What is the meaning of && in c?

1025


How do I create a directory? How do I remove a directory (and its contents)?

1174


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.

2060


What is a string?

1127


What is the difference between new and malloc functions?

1135


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1254