Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 10

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 125

Answer:

main()
{
printf("%x",-1<<4);
}


Answer:
fff0


Explanation :
-1 is internally represented as all 1's. When left shifted four times the least significant 4 bits are filled with 0's.The %x format specifier specifies that the integer value be printed as a hexadecimal value.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 10 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: