S Majumder wrote:Hi Meenaakshi,
First of all when you submit any code please try to use [code=java] tags.it helps people to understand your code .Now come to your code .It is a very basic recursive function .
In the first case when using {} it will call itself untill the condition is satisfied and will print the result and stopped .
In the second case where no {} it will call itself infinite times because there is to stop condition .
Hope you understand .
Satya
I am new to Programming. for the code without {}, there is a if condition mentioned. when n=0 the condition should fail there know. Wht does not it fail.