[ create a new paste ] login | about

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

C++, pasted on Jan 22:
#include <iostream>
#include <cmath>
 
using namespace std;
 
 
int main()
{
    cout.flush();
 
    int sum = 0, total = 0;
 
    for (int i=1; i<=10; i++)
    {
        sum = pow(i, 2);
        total += sum;
    }
 
    cout<<"Sum = " <<total;
    cin.get();
 
    return 0;
}


Output:
1
2
3
In function 'int main()':
Line 15: error: call of overloaded 'pow(int&, int)' is ambiguous
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: