Thursday, February 4, 2010

A simple C program to add two numbers

//program using functions
#include
#include
get(int,int);
void main()
{
int a,b,sum;
clrscr();
printf("Type two numbers");
scanf("%d",&a);
scanf("%d",&b);
sum=get(a,b);
printf("Sum=%d",sum);
getch();
}
get(a,b)
{
int sum;
sum=a+b;
return(sum);
}

No comments:

Post a Comment