basic help with Recursive
I'm trying to use Recursive, I know how to use it and i understand it, but the problem i have is that i have to use 2 input variables, and I don't know how to mix them both.
My program should take a number, add an exponential number (user inputed) and do the math.
This program work, but i have no idea where to add the 2nd input. help pls :(
public class testing1
public static void main( String  args )
int num1, num2, answer;
Scanner kb = new Scanner(System.in);
// Get number.
System.out.print("Enter number: ");
num1 = kb.nextInt();
// Get exponential number.
System.out.print("Enter exponential number: ");
num2 = kb.nextInt();
// compute and output it.
System.out.println(num1 + "^" + num2+ " is: " + factorial(num1));
public static int factorial( int n )
if ( n <= 0 ) // base case
else // general case
return ( n * factorial ( n - 1 ) );