Arithematic operators Program
Amit Waghmare
December 28, 2019
First we see what does Arithmetic Operator mean?
Arithmetic operator is a mathematical function that takes two inputs and performs a calculation on them. They are used in common arithmetic and most computer languages contain a set of such operators that can be used within equations to perform a number of types of sequential calculation. Basic arithmetic operators include:
- Addition (+): It displays the addition of two numbers. Eg. 4+6=10
- Subtraction (-):It performs the subtraction of two numbers. Eg.5-2=3
- Multiplication (×):It performs the Multiplication of two numbers. Eg.5*7=35
- Division (÷):It performs the Division of two numbers. Eg. 6/2=3
- Modula(%):It displays the remainders. Eg. 6%4=2
Computers use different symbols in programming to represent multiplication (*) and division (/). More complex operators such as square root (√) also act as arithmetic operators but the basic plus, minus, multiply and divide are the fundamental operators.
C language code for addition, subtraction, multiplication, division and modulo:
#include<studio.h>
#include<condo.h>
float main ()
{
float a, b,add, sub, mul, div, rem;
closcr();
printf ("ENTER THE TWO NUMBERS TO FIND THE ADDITION ,SUBTRACTION, MULTIPLICATION, DIVISION, REMAINDER\n");
scanf ("%f%f",&a&b);
add=a+b;
sub=a-b;
mul=a×b;
div=a/b;
rem=a%b;
printf ("ADDITION=%f\n", add);
printf ("SUBTRACTION=%f\n", sub);
printf ("MULTIPLICATION=%f\n", mul);
printf ("DIVISION=%f\n", div);
printf ("REMAINDER=%f\n", rem);
getch();
return();
}
Friends in this code we perform all operations. If we use floating points then it accepts the integers also, so better way use float points.
In this code clrscr() is new concept.It means that the previous output is clear. Try it automatically you learn.
The following images show the actual code and output screen.
This is the input screen I.e.coding screen.
This Window shows that there is no error in the code.
This is the final output screen with example.
Friends such information I was typing on mobile so remainder operations are not possible but on the latest version it did or on the computer it did easily.
If any query is there then write in the comment box.Thank you...
Arithematic operators Program
Reviewed by Amit Waghmare
on
December 28, 2019
Rating: