View Full Version : [C++] potenze
theberto
08-06-2010, 14:03
come posso elevare una variabile reale ad un'altra variabile reale tutte e due di tipo double?
grazie
con la funzione pow: http://www.cplusplus.com/reference/clibrary/cmath/pow/
esempio:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double a, b;
cin >> a >> b;
cout << pow(a, b) << endl;
return 0;
}
theberto
09-06-2010, 15:53
grazie a tutti
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.