Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Exercise 50

C Exercise 50

100 Classic C Language Examples 100 Classic C Language Examples

Problem:Practice using #include.

**Analysis:** None.

Program source code:

The code in the test.h file is as follows:



#define LAG >

#define SMA <

#define EQ ==

Main file code:



//  Created by www.runoob.com on 15/11/9.

//  Copyright © 2015 Runoob Tutorial. All rights reserved.

//



#include "test.h"  

#include 



int main()

{

    int i=10;

    int j=20;

    if(i LAG j)

        printf("%d 大于 %d \n",i,j);

    else if(i EQ j)

        printf("%d 等于 %d \n",i,j);

    else if(i SMA j)

        printf("%d 小于 %d \n",i,j);

    else

        printf("没有值。\n");

    return 0;

}

The output of the above example is:



10 小于 20 

100 Classic C Language Examples 100 Classic C Language Examples