Back To C User Defined Functions Index
//program to create a function that takes two integers arguments and calculates their sum #include
#include
void sum(int,int); void sum(int a,int b) { int sum; sum=a+b; printf("sum of numbers is %d",sum); } void main() { int a,b; clrscr(); printf("enter value for a"); scanf("%d",&a); printf("enter value for b"); scanf("%d",&b); sum(a,b); getch(); }