Saturday, March 21, 2015

TRUE or FALSE in C Pgm



#include 
 
typedef int Bool;
 
const Bool TRUE = 1;
const Bool FALSE = 0;
 
void main () 
{
 
  int zero = 0;
  int two = 2;
  int three = 3;
 
  cout << (FALSE && (1/zero == 5)) << endl;
  cout << ((1/zero == 5) && FALSE) << endl;
  cout << ((1/zero == 5) && (two == three)) << endl;
}
 
/** Result:
 
0
0
Floating exception
 
**/
 

No comments:

Post a Comment