arithmetic operations,write a c program to enter two numbers and perform all arithmetic operations,c program to divide two numbers,c program to subtract two numbers,c program to multiply two numbers,c program for arithmetic operations,c program to perform arithmetic operations,cprogram to print all arithmatic operations,arithmetic operation in c,to perform all arithmetic operation using c language 

In this blog we will learn how to perform arithmetic operation in c of two numbers.

Logic to solve code

1. Input the two numbers.

2. Then, perform the all operation one by one.

3. Finally print all the values after all operation.

Example
INPUT

Enter two numbers:
5
2

OUTPUT

Sum is 7
Subtraction is 3
Multiplication is 10
Division is 2.5

Full Code of Performing all Arithmetic Operation  of two numbers.

 /*  
  * Program to find the all arithmetic operation of two numbers  
  */  
   
  #include<stdio.h>  
   
  int main()  
  {  
    int a, b, Sum, Subtract, Multiply, Divide;  
    /*  
    a and b for two numbers and others for the same  
    */  
    printf("Enter the first number\n");  
    // Input the first number  
    scanf("%d",&a);  
   
    printf("Enter the second number\n");  
     // Input the second number  
    scanf("%d",&b);  
   
    Sum = a + b;   //this perform the sum  
    // For printing the sum values  
    printf("Sum of two numbers %d and %d is %d.\n",a,b,Sum);  
   
    Subtract = a - b;   //this perform the subtraction  
    // For printing the subtraction values  
    printf("Subtraction of two numbers %d and %d is %d.\n",a,b,Subtract);  
   
    Multiply = a * b;   //this perform the multipication  
    // For printing the multiplication values  
    printf("Multiplication of two numbers %d and %d is %d.\n",a,b,Multiply);  
   
    Divide = a/b;   //this perform the division  
    // For printing the division values  
    printf("Division of two numbers %d and %d is %d.",a,b,Divide);  
   
   
   return 0;  
   
  }  
   
\n is used for changing the line. After enter the values and after performing the operations.

Output
Enter the first number
5
Enter the second number
2
Sum of two numbers 5 and 2 is 7.
Subtraction of two numbers 5 and 2 is 3.
Multiplication of two numbers 5 and 2 is 10.
Division of two numbers 5 and 2 is 0.00.

I hope you know very well how to add two numbers in C language. If you like this posts. Then, Please Comment Us!