Untitled
Anonymous
c_cpp
10/11/2020 5:07 PM
620 B
15
Indexable
// Example program
#include <iostream>
#include <string>
using namespace std;
float input(float variable) {
cin >> variable;
cout << endl;
return variable;
}
float medium(float a, float b, float c, float d) {
return ((a + b + c + d) / 4.0);
}
int main() {
float a,b,c,d;
cout << "a=";
a = input(a);
cout << "b=";
b = input(b);
cout << "c=";
c = input(c);
cout << "d=";
d = input(d);
cout << "Result: ";
cout << medium(a, b, c, d);
return 0;
}Editor is loading...