Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- double potencia(double base, double exponent);
- const int TAM = 5;
- struct registro {
- int id;
- string name;
- float rate;
- };
- int main(int argc, char** argv) {
- const int TAM = 8;
- registro datos[TAM] = {01, "Paco", 5.25,
- 02, "Miriam", 6.25,
- 03, "Paco", 5.25,
- 04, "Miriam", 6.25,
- 05, "Martin", 8, 25};
- int i;
- int *ptrb;
- for (i = 0; i< ::TAM; i++) {
- cout << datos[i].id << endl;
- }
- int x=5;
- double base1, exponent1;
- cout << &TAM<<endl;
- cout<<"Dame Base"<<endl;
- cin>>base1;
- cout<<"Dame exponente"<<endl;
- cin>>exponent1;
- cout<<potencia(base1, exponent1)<<endl;
- return 0;
- }
- double potencia(double base, double exponent){
- return pow(base,exponent);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement