Back To C User Defined Functions Index
//program to create a function that takes two integer arguments calculates difference between them #include
#include
void difference(int,int); void difference(int a,int b) { int diff; diff=a-b; printf("difference between two numbers is %d",diff); } void main() { int a,b; clrscr(); printf("enter value for a"); scanf("%d",&a); printf("enter value for b"); scanf("%d",&b); difference(a,b); getch(); }