Function Calling in c++
#include <iostream>
using namespace std;
//declaring a function
void sum()
{
int x,y;
cout << "enter the two number x and y";
cin>>x>>y;
cout<<"sum is "<<x+y;
}
int main ()
{
// calling the function
sum();
return 0;
}
Output
Function Calling in c++
#include <iostream>
using namespace std;
//declaring a function
void sum()
{
int x,y;
cout << "enter the two number x and y";
cin>>x>>y;
cout<<"sum is "<<x+y;
}
int main ()
{
// calling the function
sum();
return 0;
}
Output