Advertisement
Aminpro

[ECP 1026]Tutorial 3 Question 1

Nov 21st, 2012
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2. //(i)
  3. int powerR(int x, int n){
  4. int result;
  5.  
  6. if(n==0)
  7. result 1;
  8. else
  9. result=x* powerR(x, n-1);
  10.  
  11. return result;
  12. }
  13.  
  14. //(ii)
  15. int powerI(int x, int n){
  16. int result=1,i;
  17. for()
  18.  
  19. //(iii)
  20. int result1, result2;
  21.  
  22. result1 = powerR(x,n);
  23. result2 = powerI(x,n);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement