answersLogoWhite

0

public class Main{

public static void main(String[] args){

System.out.println("the factorial of 5 is: " + getFactorial(5));

}

public static int getFactorial(int num){

return num + getFactorial(num-1);

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Write a program to find gcd using recursive method in java?

for two positive integers: public static int gcd(int i1, int i2) { // using Euclid's algorithm int a=i1, b=i2, temp; while (b!=0) { temp=b; b=a%temp; a=temp; } return a; }


What is javadoc?

write a java program to display "Welcome Java" and list its execution steps.


Can you provide a solution to the diamond-square algorithm using Java and recursion?

Yes. It is possible to provide a solution to the diamond-square algorithm using Java and recursion.


How write new line program in java?

\n


How do you write a java program for finding multiligual languages?

You can use Java's built-in functions to write a code that will find multilingual languages.


How java is 100 percent Internet based?

It isn't. It can also be used to write desktop applications. Java does have many options to program for the Internet, but that is not the only possibility.It isn't. It can also be used to write desktop applications. Java does have many options to program for the Internet, but that is not the only possibility.It isn't. It can also be used to write desktop applications. Java does have many options to program for the Internet, but that is not the only possibility.It isn't. It can also be used to write desktop applications. Java does have many options to program for the Internet, but that is not the only possibility.


Write a java code to draw a circle inside in an ellipse?

write a program draw circle and ellipse by using oval methods in java


How do you write a java program to find the ad joint of a matrix?

bgfygfrhjyuyhh


How do you write algorithms of java programs?

Write a program that graphically demonstrates the shortest path algorithm


How To write a java program to create three tier applications using servlets?

barsanabegam