Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 62

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

Answer:

main()
{
char not;
not=!2;
printf("%d",not);
}


Answer:
0


Explanation:
! is a logical operator. In C the value 0 is considered to be the boolean value FALSE, and any non-zero value is considered to be the boolean value TRUE. Here 2 is a non-zero value so TRUE. !TRUE is FALSE (0) so it prints 0.

Share: 
 

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


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


Tagged: