[ create a new paste ] login | about

Link: http://codepad.org/d3MaECQ9    [ raw code | output | fork ]

C++, pasted on Dec 15:
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;
}


Output:
1
2
3
3.14159
6.28319
73.8274


Create a new paste based on this one


Comments: