cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Help w/ patterns &series?
Help w/ patterns &series?
Oct 9, 2015 at 10:05am UTC
hibine
(1)
Hi, I'd appreciate any help with the source code for following series/ patterns.
1.
A
C A
E C A
G E C A
2.
&
& &
& &
& &
&&&&&&&&&
3.
2 + 2 + 4³ + 2 + 4³ + 6^5 ...etc.
(sorry, couldn't find Alt-Code to raised-to-5)
Any help is greatly appreciated. :-)
Oct 9, 2015 at 10:18am UTC
YFGHNG
(319)
I believe you're looking for recursion.
http://www.danzig.us/cpp/recursion.html
Also you don't actually have to use alt codes. There's convenient format buttons for every time you post something, and there just so happens to be
superscript
and
subscript
buttons.
An example of recursion pseudocode would go something like:
1
2
if
x == 1,
return
some
int
else
function(x-1)
Topic archived. No new replies allowed.