AleksandarArkan

R-Elevamento a potenza

Mar 26th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. double  power(double   a,  int   b){
  2.     double prodotto;
  3.     prodotto=1;
  4.    
  5.     if(b!=0){
  6.         prodotto=a*power(a,b-1);
  7.         }
  8.     //prima o poi la b sara' uguale a 0
  9.     return prodotto;
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment