C Program To Demonstrates Binary Expressions Using Integer Arithmetic

How To Write a C Program To Demonstrates Binary Expressions Using Integer Arithmetic in C Programming Language ?


Solution For C Program To Demonstrates Binary Expressions Using Integer Arithmetic:
#include<stdio.h>
main()
{
/* Local Definitions */
int a = 5;
int b = 5;

/*Statements*/

printf("%d + %d = %d\n", a ,b, a + b);
printf("%d - %d = %d\n", a ,b, a - b);
printf("%d * %d = %d\n", a ,b, a * b);
printf("%d / %d = %d\n", a ,b, a / b);
printf("%d %% %d = %d\n", a ,b, a % b);

}
Output :
5 + 5 = 10
5 - 5 = 0
5 * 5 = 25
5 / 5 = 1
5 % 5 = 0
Note :
In order to print “%” symbol inside printf, use “%%”. because % symbol has pre-defined meaning inside printf statement.
Tags:  C Program To Demonstrates Binary Expressions Using Integer Arithmetic, arithmetic expression in c language, c program to evaluate arithmetic expression using stack, arithmetic expression evaluation using stack in c, days = days - 2 * 2, evaluation of expressions in c, arithmetic expression in c++, evaluation of arithmetic expression, arithmetic expression examples.


Learn More :