FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 117   



C Language supports basic 5 types of Arithmetic operations.

Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
/% Modulus Division

Following is a sample C Language program which describes all the above operations.

#include <stdio.h>

int main() {
    int a = 10;
    int b = 5;

    int sum  = a + b;
    int sub  = a - b;
    int mul  = a * b;
    int div  = a / b;
    int modu = a % b;

    printf("sum: %d\n", sum);
    printf("sub: %d\n", sub);
    printf("mul: %d\n", mul);
    printf("div: %d\n", div);
    printf("modu: %d\n", modu);
}

Output :

sum: 15
sub: 5
mul: 50
div: 2
modu: 0



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News