Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*program to add,subtract,multiply and divide two integers using user defined type function with return type.*/
#include<stdio.h>
#include<conio.h>
void sum(int x, int y);
void sub(int x, int y);
void mult(int x, int y);
void div(int x, int y);
void main()
{
int a,b;
printf("enter two numbers:");
scanf("%d %d",&a,&b);
sum(a,b);
sub(a,b);
mult(a,b);
div(a,b);
getch();
}
void sum(int x,int y)
{
printf("sum=%d\n",x+y);
}
void sub(int x,int y)
{
printf("difference=%d\n",x-y);
}
void mult(int x,int y)
{
printf("product=%d\n",x*y);
}
void div(int x,int y)
{
printf("quotient=%f\n",(float)x/y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.