Wednesday, December 2, 2009

Using define without assigning value

#define NO
#define YES

int main()
    int i = 5,j;
    if (i>5)   j=YES;
    else j=NO;


Output: Expression syntax in function main
Explanation:  Because when assigning j with YES or NO we don't know what is the value of YES or NO.

No comments:

Post a Comment