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 / sathish

go through right shift & left shift operator function.

Ex: a<<2 = 5<<2 = 00000101(in binary)<<2 = 00010100(in
binary) = 20(in decimal)

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I change their mode to binary?

686


What happens if you free a pointer twice?

596


what are the different storage classes in c?

656


Once I have used freopen, how can I get the original stdout (or stdin) back?

618


Explain how can you check to see whether a symbol is defined?

654






How can my program discover the complete pathname to the executable from which it was invoked?

653


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

1897


What are type modifiers in c?

613


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

698


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15480


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

660


What is c mainly used for?

589


What is the difference between if else and switchstatement

1307


What is an array? What the different types of arrays in c?

649


What is adt in c programming?

602