-
-
Save programmingfaster0226/2df78ceba939dcd45317dc903f18321e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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