Using the methods
FindSum(int, int) //returns total
FindProduct(int, int) //returns the product of the two integers
Write the main method to find and print the answer of the expression;
#include<iostream>
using namespace std;
int FindSum(int a, int b){
int result;
result = a + b;
return result;
}
int FindProduct(int a, int b){
int result;
result = a * b;
return result;
}
int main() {
cout << FindSum(2,3) << endl;
cout << FindProduct(2,3) << endl;
return 0;
}
Comments
Leave a comment