Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,553 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,907 people online right now. Registration is fast and FREE... Join Now!




recursive function

 
Reply to this topicStart new topic

recursive function, prime factors

abiezer
11 Apr, 2008 - 01:42 PM
Post #1

New D.I.C Head
*

Joined: 11 Apr, 2008
Posts: 1

Can anyone give me some hints on how to write a recursive function to find the prime factors of a number?
User is offlineProfile CardPM
+Quote Post

Mike007
RE: Recursive Function
11 Apr, 2008 - 02:52 PM
Post #2

D.I.C Head
Group Icon

Joined: 30 Aug, 2007
Posts: 205


Dream Kudos: 75
My Contributions
Well, the idea with recursive functions is that you think of a big piece as consisting of a smaller that in turn is a part of a smaller piece until you reach the smallest piece possible. In your case the smallest piece would be the prime numbers.

There's your hint, a pretty fat one if i may say, good luck.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 11:17PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month