Answer to Question #266225 in C++ for manci

Question #266225

Write a function ComputeVal that takes one integer parameter and returns 4 times the parameter. 

Ex: ComputeVal(3) returns 12.


1
Expert's answer
2021-11-15T00:19:32-0500
#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;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS