Average of two arguements

PHOTO EMBED

Fri Sep 23 2022 15:17:20 GMT+0000 (UTC)

Saved by @Kyle #c++

#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;
}
content_copyCOPY