#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 << "____________________________\n"
        << "The average of these two numbers are "
        << ave << endl;
    return 0;
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