Source Code :
#include<iostream>
using namespace std;
void add(int a,int b)
{
int c;
c=a+b;
cout<<"The sum of the numbers are: ";
cout<<c;
}
int main()
{
int x ,y;
cout<<"Enter two numbers: ";
cin>>x>>y;
add(x,y);
return 0;
}
#include<iostream>
using namespace std;
void add(int a,int b)
{
int c;
c=a+b;
cout<<"The sum of the numbers are: ";
cout<<c;
}
int main()
{
int x ,y;
cout<<"Enter two numbers: ";
cin>>x>>y;
add(x,y);
return 0;
}
Program Output :
Enter two numbers: 5
6
The sum of the numbers are: 11
No comments:
Post a Comment