Arithmetic Operators in C

These operators are used to perform mathematical operations. e.g. Addition, Subtraction, Multiplication, Division, Modulus

+ ( Addition ): Used to perform addition of two operands or variable. If an expression x + y, it will give a sum of x and y.

– ( Subtraction ): Used to perform subtraction of two operands or variable. If an expression is x – y, it means y is subtracted from x.

* ( Multiplication ): Used to perform multiplication of two operands or variables. If an expression is x * y, it will give multiplication of x and y.

/ ( Division ):  Used to perform division operation of two operands or variables. If an expression is x / y, it will give quotient.

% ( Modulus ): Used to perform modulus operation of two operands or variables. If an expression is x % y, it will returns remainder.

Here is a C program to demonstrate the arithmetic operators

/**
* To demonstrate the arithmetic operators in C
*/
#include<stdio.h>
int main ( int argc, char **argv )
{
int x = 10;
int y = 12;
/* Addition : x + y = 22 */
printf("Addition : x + y = %d \n", x + y );
/* Subtraction : x - y = -2 */
printf("Subtraction : x - y = %d \n", x - y );
/* Multiplication : x * y = 120 */
printf("Multiplication : x * y = %d \n", x * y );
/* Division : x / y = 0 */
printf("Division : x / y = %d \n", x / y );
/* Modulus : x % y = 0 */
printf("Modulus : x %% y = %d \n", x % y );
return 0;
}

Hope, it would be helpful !!

To contribute :

” If you like Advance Computing and would like to contribute, you can  mail your article to “computingadvance@gmail.com”. You will get credit as your name , email id, designation with article on this blog. “

Leave a Reply