Answer to Question #185300 in C++ for Nethu

Question #185300

Using the methods

Findsum(int,int) //return total

FindProduct(int,int) //returns the product of the two integers

Write main method to find and print the answer of the expression,

32 + 83 +91

1
Expert's answer
2021-04-25T07:28:07-0400
#include <iostream>
using namespace std;
int FindProduct(int a, int b){
    int product = 1;
    for(int i = 0; i < b; i++){
        product *= a;
    }
    return product;
}
int Findsum(int a, int b){
    return a + b;
}
int main(){
    cout<<Findsum(Findsum(FindProduct(3, 2), FindProduct(8, 3)), FindProduct(9, 1));
    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