Tuesday, 9 January 2018
c++ how to make function that sum the number
#include<iostream>
using namespace std;
void sum (int&, int&);
main()
{
int a,b;
cin>>a>>b;
sum(a,b);
}
void sum(int &c, int &d)
{
int sum;
sum=c+d;
cout<<"sum is: "<<sum;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment