Write symbolic constants for the binary arithmetic operators +, -, *, and /. Write a C program to illustrate the use of these symbolic constants.
Program Code:
#include<stdio.h>
#define PLUS +
#define MINUS -
#define MUL *
#define DIV /
#define MOD %
void main()
{
int a=20,b=30;
printf("\n addition=%d",a PLUS b);
printf("\n subtraction=%d",a MINUS b);
printf("\n multiplication=%d",a MUL b);
printf("\n division=%d",a DIV b);
printf("\n modulous=%d",a MOD b);
}
Post A Comment:
0 comments: