Arithmetic Operators

Arithmetic operators are used to performing arithmetic operations on data.

The arithmetic operators can operate on any built-in data type.

The arithmetic operators are :

+ Addition operator
Subtraction operator
* Multiplication operator
/ Division operator
% Modulo division operator

Arithmetic operations program

        
#include <stdio.h>

int main()
{
    int a = 20, b = 10;
    int c;

    c = a + b;
    printf("Sum = %d\n", c);

    c = a - b;
    printf("Subtract = %d\n", c);
                    
    c = a * b;
    printf("Multiple = %d\n", c);

    c = a / b;
    printf("Division = %d\n", c);

    c = a % b;
    printf("Modulo division = %d\n", c);

    return 0;
}
        
    

Output

        
Sum = 30
Subtract = 10
Multiple = 200
Division = 2
Modulo division = 0
        
    

Post a Comment

0 Comments