Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include <math.h>
  2. #include <cstdlib>
  3. #include <iostream>
  4. using namespace std;
  5. double potencia(double base, double exponent);
  6. const int TAM = 5;
  7.  
  8. struct registro {
  9. int id;
  10. string name;
  11. float rate;
  12.  
  13. };
  14.  
  15. int main(int argc, char** argv) {
  16.  
  17. const int TAM = 8;
  18.  
  19. registro datos[TAM] = {01, "Paco", 5.25,
  20. 02, "Miriam", 6.25,
  21. 03, "Paco", 5.25,
  22. 04, "Miriam", 6.25,
  23. 05, "Martin", 8, 25};
  24. int i;
  25. int *ptrb;
  26.  
  27. for (i = 0; i< ::TAM; i++) {
  28. cout << datos[i].id << endl;
  29. }
  30.  
  31. int x=5;
  32.  
  33.  
  34.  
  35.  
  36.  
  37. double base1, exponent1;
  38. cout << &TAM<<endl;
  39.  
  40. cout<<"Dame Base"<<endl;
  41. cin>>base1;
  42. cout<<"Dame exponente"<<endl;
  43. cin>>exponent1;
  44.  
  45. cout<<potencia(base1, exponent1)<<endl;
  46.  
  47. return 0;
  48. }
  49.  
  50.  
  51.  
  52. double potencia(double base, double exponent){
  53.  
  54. return pow(base,exponent);
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement