Question: I am attempting to create a C++ program that multiplies 3 pairs of numbers using only recursion and addition but I keep getting this error

I am attempting to create a C++ program that multiplies 3 pairs of numbers using only recursion and addition but I keep getting this error "Control may reach end of non-void function" I don't know how to fix it.

I am attempting to create a C++ program that multiplies 3 pairs

9 #include 10 using namespace std; 2 int multRec (int x , int y)i 13 14 int main) 15 16 17 18 19 20 21 int pairs (3; int ate) int b(0) pairs ; ++counter) { for (unsigned int counter {1); counter cout bi cout bi 28 30 31 int multRec (int x, int y) 32 if (y > 1) else if ( x=-e II y-0 ) { else if (y-1) { return (x multRec(x,--y)) 34 35 36 return 0; 38 return x 41 Control may reach end of non-void function 043

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!