One book gives this:
#include <iostream>
using namespace std;
double sum(float x, float y)
{
return (x+y);
}
int main()
{
double a,b,S;
cout << "A = ";
cin >> a;
cout << "B = ";
cin >> b;
S = sum(a,b);
cout << "S = " << S << endl;
return 0;
}
And the other one this:
#include <iostream>
using namespace std;
double sum(float x, float y);
int main()
{
double a,b,S;
cout << "A = ";
cin >> a;
cout << "B = ";
cin >> b;
S = sum(a,b);
cout << "S = " << S << endl;
}
double sum(float x, float y)
{
return (x+y);
}
Is there any difference, should I worry about it?
PS: This is a tiny example I made by myself so you all can notice the difference without going through too much code.


Sign In
Create Account


Back to top










