Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

=+ Are ballots compulsory?

Answered: 1 week ago