/*Arithmetic Operations*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
int ch;
printf("enter the numbers");
scanf("%d%d",&a,&b);
printf("enter your choice");
Printf("1.multiplication,2.division,3.addition,4.subtraction");
scanf("%d",&ch);
if(ch>0)
{
if(ch==1)
{
printf("product=%d",a*b);
}
else
if(ch==2)
{
printf("quotient=%d",a/b);
}
else
if(ch==3)
{
printf("sum=%d",a+b);
}
else
if(ch==4)
{
printf("diff=%d",a-b);
}
else
printf("Invalid choice");
getch();
}
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
int ch;
printf("enter the numbers");
scanf("%d%d",&a,&b);
printf("enter your choice");
Printf("1.multiplication,2.division,3.addition,4.subtraction");
scanf("%d",&ch);
if(ch>0)
{
if(ch==1)
{
printf("product=%d",a*b);
}
else
if(ch==2)
{
printf("quotient=%d",a/b);
}
else
if(ch==3)
{
printf("sum=%d",a+b);
}
else
if(ch==4)
{
printf("diff=%d",a-b);
}
else
printf("Invalid choice");
getch();
}
}
No comments:
Post a Comment