Easy Tutorial
❮ C Examples Sum Array C Macro Assert ❯

C Practice Example 50

C Language Classic 100 Examples

Title: Practice with #include.

Program Analysis: None.

Program Source Code:

test.h file code is as follows:

#define LAG >
#define SMA <
#define EQ ==

Main file code:

//  Created by www.tutorialpro.org on 15/11/9.
//  Copyright © 2015 tutorialpro.org. All rights reserved.
//

#include "test.h"  
#include <stdio.h>

int main()
{
    int i=10;
    int j=20;
    if(i LAG j)
        printf("%d is greater than %d \n",i,j);
    else if(i EQ j)
        printf("%d is equal to %d \n",i,j);
    else if(i SMA j)
        printf("%d is less than %d \n",i,j);
    else
        printf("No value.\n");
    return 0;
}

The output of the above example is:

10 is less than 20

C Language Classic 100 Examples

❮ C Examples Sum Array C Macro Assert ❯