Search This Blog

C program for calculating sum of 2 numbers using user defined function

//coded by Z
#include<stdio.h>
int sum(int a,int b);
void main()
{
int x,y;
clrscr();
printf("enter two no:s \n");
scanf("%d %d",&x,&y);
printf("sum=%d",sum(x,y));
getch();
}
int sum(int a,int b)
{
int s;
s= a+b;
return (s);
}

No comments:

Post a Comment