How do I write a recursive function to compute (3^2)+(3^3)+(3^4).......+(3^n) ?
DS9596 0 Junior Poster in Training
Recommended Answers
Jump to PostWhat have you done, besides posting your homework assignment?Show your code to us and pinpoint the errors you have.We will be more than happy to help. :)
Jump to PostDon't call your function, "function" or "func". Name it after what your function does.
You have defined a function prototype which can accept one int parameter, yet you use that function function with two parameters on line 25.
Jump to PostDoes line 7:
int func(int);
look the same as line 22:int func(int base, int power)
?
All 9 Replies
ddanbe 2,724 Professional Procrastinator Featured Poster
helmi_1 0 Newbie Poster
David W 131 Practically a Posting Shark
DS9596 0 Junior Poster in Training
DS9596 0 Junior Poster in Training
ddanbe 2,724 Professional Procrastinator Featured Poster
DS9596 0 Junior Poster in Training
NathanOliver 429 Veteran Poster Featured Poster
David W 131 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.