Skip to content

Instantly share code, notes, and snippets.

@programmingfaster0226
Created January 18, 2018 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save programmingfaster0226/2df78ceba939dcd45317dc903f18321e to your computer and use it in GitHub Desktop.
Save programmingfaster0226/2df78ceba939dcd45317dc903f18321e to your computer and use it in GitHub Desktop.
/*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