ARITHMETICAL OPERATORS SYMBOLIC TABLE
OPERATORS
|
MEANING OF OPERATOR
|
+
|
Addition
|
-
|
Subtraction
|
*
|
Multiplication
|
/
|
Division
|
%
|
Modulus (Get remainder after division)
|
ARITHMETICAL OPERATOR EXAMPLES
Example of Addition, Subtraction, Multiplication and Division operators.
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a=6, b=4;
printf("Addition is: %d",a+b);
printf("\nSubtraction is: %d",a-b);
printf("\nMultiplication is: %d",a*b);
printf("\nDivision is: %d",a/b);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
n=7;
if(n%2 ==0)
printf("Even value");
else
printf("Odd value");
getch();
}
No comments:
Post a Comment