daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Exponential{
  2.    
  3.     public static void main(String []args){
  4.              
  5.          int a = 2;
  6.          int b = 2;
  7.          int result = rExponential(a, b);
  8.          System.out.println("Result:"+result);
  9.         }
  10.      
  11.      int rExponential(int n, int e){
  12.          
  13.          int exp;
  14.          
  15.          if(e ==0)
  16.             return 1;
  17.          else  
  18.          if(e == 1)
  19.             return n;
  20.            
  21.         else
  22.         if(e<0){
  23.             exp = 1/10;
  24.             exp*= rExponential(n, e+1);
  25.             return exp*n;
  26.         }
  27.            
  28.          else{
  29.              exp*= rExponential(n, e-1);
  30.              return exp;
  31.          }    
  32.      }
  33.      
  34.          
  35.      
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top