Write a program to demonstrate the results obtained by using the arithmetic operators for addition, subtraction, multiplication and division on integer data.
C Programming Language Operators and Enums in C Language (Article) Operators and Enums in C Language (Program)
1260Program:
/* 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
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.