C++ program for use of function
#include <iostream>
using namespace std;
void Add(float, float, float);
int main()
{
float f1,f2,f3;
cout<<"Enter three float numbers:"<<endl;
cin>>f1>>f2>>f3;
Add(f1,f2,f3); //actual arguments
return 0;
}
void Add(float x, float y, float z)
{
float sum=x+y+z;
cout<<"The sum is: "<<sum;
}
No comments:
Post a Comment