#include <iostream>
using namespace std;
double var(int x, double y) {
return ((x + y)/2);
}
int main()
{
double y, ave;
int x;
cout << "Average of two arguements\n"
<< "----------------------------\n"
<< "Please enter arguement x: ";
cin >> x;
cout << "Please enter arguement y: ";
cin >> y;
ave = var(x, y);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(1);
cout << "____________________________\n"
<< "The average of these two numbers are "
<< ave << endl;
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter