# Difference between recursion and function

Page 1 of 1

## 2 Replies - 8168 Views - Last Post: 18 December 2012 - 05:50 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=304278&amp;s=65fe2ae76470fc4759af428307441612&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 coolbud012

Reputation: 0
• Posts: 43
• Joined: 01-July 11

# Difference between recursion and function

Posted 18 December 2012 - 03:38 AM

Hey guys I am not new to programming but I really dont know the difference between recursion or function...I know these are the basic things so thats why I want to clear them. Also are there functions used in java or those are called methods in java?

Now coming to C, I wrote a program of factorial in C. First I wrote it using loops, alright then I thought of writing it through recursion and what I end up with was making a program of factorial using functions, I really dont know the basic difference... If someone have basic notes or some link from where I can read more basic concepts then please provide me. Even I tried google but didnt get any useful result.

Thanks

Is This A Good Question/Topic? 0

## Replies To: Difference between recursion and function

• Saucy!

Reputation: 6207
• Posts: 23,953
• Joined: 23-August 08

## Re: Difference between recursion and function

Posted 18 December 2012 - 04:08 AM

Factorial tutorial with recursion

### #3 sepp2k

• D.I.C Lover

Reputation: 2271
• Posts: 3,486
• Joined: 21-June 11

## Re: Difference between recursion and function

Posted 18 December 2012 - 05:50 AM

A function (in the C sense) is something that's defined using the syntax type function_name(parameter_list) { body }. A recursive function is a function that calls itself within the body of the function. So recursion is the act of a function calling itself within its body.

So yes, if you solve a problem using recursion, you're going to be using functions as there is no recursion without functions (of course there's no C program at all without functions either...).