Why the output for "a" is -80?

Posted by Abhi on Stack Overflow See other posts from Stack Overflow or by Abhi
Published on 2010-03-22T11:05:53Z Indexed on 2010/03/22 11:11 UTC
Read the original article Hit count: 229

Filed under:
|
|
#include<stdio.h>
#include<conio.h>
#define ABC 20
#define XYZ 10
#define XXX ABC - XYZ

void main()
{
    int     a;

    a = XXX * 10;

    printf("\n %d \n", a);

    getch();
}

I thought the output should be 100 but when i saw the result i found o/p as -80. when i put bracket as #define XXX (ABC-XYZ) then i get output as 100 but without bracket i get o/p as -80.

© Stack Overflow or respective owner

Related posts about c

    Related posts about preprocessor