Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. /*
  8. * File: main.cpp
  9. * Author: Alumno
  10. *
  11. * Created on 26 de julio de 2016, 11:45 AM
  12. */
  13.  
  14. #include <iostream>
  15. #include <math.h>
  16.  
  17. using namespace std;
  18.  
  19. double potencia(double &base, double &exponente);
  20.  
  21.  
  22. int main() {
  23. double x=2;
  24. double y=3;
  25. cout<<potencia(x,y)<<endl;
  26. cout<<"x= "<<x<<endl;
  27. cout<<"y= "<<y<<endl;
  28. return 0;
  29. }
  30.  
  31. double potencia(double &base,double &exponente) {
  32. double pot;
  33. pot=pow(base,exponente);
  34. base+=3;
  35. exponente-=1;
  36. return pot;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement