Advertisement Area

Program #1: To Find the Sum of Three Numbers

C++ Language

#include<iostream.h>
#include<conio.h>
int sum(int,int,int);
void main()
{
    int a,b,c,result;
    clrscr();
    cout<<"Enter values of a,b,c"<<endl;
    cin>>a>>b>>c;
    result=sum(a,b,c);
    cout<<"Sum="<<result;
    getch();
}
int sum(int x,int y,int z)
{
    return(x+y+z);
}


/*OUTPUT*/
Enter values of a,b,c
2
4
6
Sum=12