Arithmetic Operators

0
  • Arithmetic operator

    C supports all the basic arithmetic operators. The following table shows all the basic arithmetic operators.
    Arithmetic operators
    S.NoOperatorsDescriptions
    1+adds two operands

    Syntax

    int a,b;

    a=10;

    b=20;

    printf("%d", a+b);
    2-Subtract two operands

    Syntax

    int a,b;

    a=20;

    b=10;

    printf("%d", a-b);
    3*Multiply the two operands

    Syntax

    int a,b;

    a=10;

    b=20;

    printf("%d", a*b);
    4/Divide numerator by denominator

    Syntax

    int a,b;

    a=10;

    b=20;

    printf("%d", a/b);//print 0
    5%remainder of Division

    Syntax

    int a,b;

    a=20;

    b=10;

    printf("%d", a%b);//print 0
    6^Power Operator

    Syntax

    int a,b;

    a=2;

    b=3;

    printf("%d", a^b);//print 8
    Practical Video


    pirority of Arthimetic operators(Higher to lower):

    ^,%,/,*,+,-



Post a Comment

0Comments

We you have any doubt let me know :)

Post a Comment (0)
To Top