1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream> #include <cmath> //para c es math.h using namespace std; float getPI( float n ) { return n * M_PI; } int main () { cout << getPI(1) << endl; cout << getPI(2) << endl; cout << getPI(23.5) << endl; cin.ignore(); return 0; }
1 2 3
3.14159 6.28319 73.8274