Home / Programs / Write a program to demonstrate the results obtained by using the arithmetic operators for addition, subtraction, multiplication and division on integer data.
Programming Example

Write a program to demonstrate the results obtained by using the arithmetic operators for addition, subtraction, multiplication and division on integer data.

👁 1,375 Views
💻 Practical Program
📘 Step by Step Learning
Write a program to demonstrate the results obtained by using the arithmetic operators for addition, subtraction, multiplication, and division on integer data.

Program Code

/*
 Program: Write a program to demonstrate the results obtained by using the
 arithmetic operators for addition, subtraction, multiplication
 and division on integer data.  
  
 Author: www.atnyla.com  
 
*/


#include "stdio.h"
int main( )
{
int a = 100;
int b = 2;
int c = 25;
int d = 4;
int result;
result = a-b;                    /*subtraction */
printf("a - b = %d \n", result);
result = b * c;                  /* multiplication */
printf("b * c = %d \n", result);
result = a / c;                  /* division */
printf("a / c = %d \n", result);
result = a + b * c;
printf("a + b * c = %d \n", result);
printf("a * b + c * d = %d\n", a* b+c*d);
return 0;
}

Output

a - b = 98
b * c = 50
a / c = 4
a + b * c = 150
a * b + c * d = 300
Press any key to continue . . .

Explanation

None

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.