Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a programe to find the factorial of given number
using recursion

Answer Posted / jessie

import util.java.Scanner
class factorial
{
public static void main(string arge[])
{
Scanner s=new Scanner(System.in);
int n=new int();
n=s.nextInt();
fact(n);
fact(int n)
{
if(n==1)
return 1;
else
return (n*fact(n-1));
}
System.out.println("the factorial of number is "+n);
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3455


Explain what is a 'locale'?

1014


Find MAXIMUM of three distinct integers using a single C statement

1011


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1214


What does dm mean sexually?

1258


What are register variables in c?

974


What is the difference between int main and void main?

996


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2130


What is the difference between volatile and const volatile?

935


how to make a scientific calculater ?

2004


How can I determine whether a machines byte order is big-endian or little-endian?

999


simple program of graphics and their output display

1936


Explain how can you restore a redirected standard stream?

1029


Differentiate call by value and call by reference?

915


What will be the outcome of the following conditional statement if the value of variable s is 10?

1230