Write a function ComputeVal that takes one integer parameter and returns 4 times the parameter.
Ex: ComputeVal(3) returns 12.
#include <iostream>
using namespace std;
int ComputeVal(int number) {
return (number*4);
}
int main() {
int input;
int result;
cout << "Enter an integer: ";
cin >> input;
result = ComputeVal(input);
cout << "ComputeVal("<<input<<") returns: "<< result << endl;
return 0;
}
Comments
Leave a comment