Home C Programming Language / 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,380 Views
💻 Practical Program
📘 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;
}
                        

🖥 Program 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
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.