Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 121

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

Answer:

void main()
{
if(~0 == (unsigned int)-1)
printf(“You can answer this if you know how values are represented in memory”);
}


Answer
You can answer this if you know how values are represented in memory


Explanation
~ (tilde operator or bit-wise negation operator) operates on 0 to produce all ones to fill the space for an integer. –1 is represented in unsigned value as all 1’s and so both are equal.

Share: 
 

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


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


Tagged: