This program will perform arithmetic operation. Here I shows for two numbers.
“+ (Addition), – (subtraction), * (multiplication), Â /(Division), Â % (Modulo) ” Â are the arithmetic operators in C Language.
But if you want to add More number than you can easily do it by using this simple program.
Here I add stdio header file which used for prinf, clrscr, getch function.
If you have any doubt than comment it. I will try to solve that problem.
[message_box title=”Program ” color=”red”]
/*Write a Program to perform arithmetic operation on two numbers*/
/* Written by Utpal Chaudhary*/
/* Student of LD College of Engineering, Ahmedabad, Gujarat.*/
#include <stdio.h>
#include <conio.h>
void main()
{
int a,b,c,d,e,f;
clrscr () ;
printf (“Enter first Number:”);
scanf (” %d ” , &a );
printf (“Enter second Number:”);
scanf (” %d “,&b);
c = a+b;
printf (“Addition:%d”,c);
d=a-b;
printf (“Subtraction:%d”,d);
e=a*b;
printf (“Multiplication:%d”,e);
f=a/b;
printf (” Division: %d “,f);
getch ();
}
[/message_box]
[message_box title=”Output ” color=”red”]
Enter first Number: 6
Enter second Number: 2
Addition: 8
Subtraction: 4
Multiplication: 12
Division: 3
[/message_box]