Some program use in arithmetic operators:
Input the two integer output there summation
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,d;
printf("Enter 1st integer=");
scanf("%d",&a);
printf("Enter 2nd integer=");
scanf("%d",&b);
d=a+b;
printf("d=%d\n",d);
getch();
}
Output:
Enter 1st integer=5
Enter 2nd integer=4
d=9
Input three integer out put the three integer summation and one integer minus other two integer summation:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e;
printf("Enter 1st integer=");
scanf("%d",&a);
printf("Enter 2nd integer=");
scanf("%d",&b);
printf("Enter 3rd integer=");
scanf("%d",&c);
d=a+b+c;
printf("d=%d\n",d);
e=a+b-c;
printf("e=%d\n",e);
getch();
}
Output:
Enter 1st integer=5
Enter 2nd integer=4
Enter 3rd integer=5
d=14
e=4
Use two integer for output the triangle area