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