0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pp1.c

Last updated at Posted at 2025-06-18

#include
#define FUDGE(k) k*3.14159
#define PR(a) printf("a= %d\t",(int)(a))
#define PRINT(a) PR(a); putchar('\n')
#define PRINT2(a,b) PR(a); PRINT(b)
#define PRINT3(a,b,c) PR(a); PRINT2(b,c)
#define MAX(a,b) (a<b ? b : a)

main()
{
{
int x=2;
PRINT( xFUDGE(2) );
/
(Preprocessor 1.1) */
}

{
	int cel;
	for( cel=0; cel<=100; cel+=50 )
		PRINT2( cel, 9./5*cel+32 );
	/* (Preprocessor 1.2) */
}

{
	int x=1, y=2;
	PRINT3( MAX(x++,y),x,y );
	PRINT3( MAX(++x,y),x,y );
	/* (Preprocessor 1.3) */
}

}

a= 12
a= 0 a= 50 a= 100 a= 302
a= 2 a= 2 a= 2
a= 4 a= 4 a= 2

#include
#define FUDGE(k) k*3.14159
#define PR(a) printf(#a"= %d\t",(int)(a))
#define PRINT(a) PR(a); putchar('\n')
#define PRINT2(a,b) PR(a); PRINT(b)
#define PRINT3(a,b,c) PR(a); PRINT2(b,c)
#define MAX(a,b) (a<b ? b : a)

void main(void)
{
{
int x=2;
PRINT( xFUDGE(2) );
/
(Preprocessor 1.1) */
}

    {
            int cel;
            for( cel=0; cel<=100; cel+=50 )
                    PRINT2( cel, 9./5*cel+32 );
            /* (Preprocessor 1.2) */
    }

    {
            int x=1, y=2;
            PRINT3( MAX(x++,y),x,y );
            PRINT3( MAX(++x,y),x,y );
            /* (Preprocessor 1.3) */
    }

}

x23.14159= 12
cel= 0 cel= 50 cel= 100 9./5*cel+32= 302
(x++<y ? y : x++)= 2 x= 2 y= 2
(++x<y ? y : ++x)= 4 x= 4 y= 2

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?