Sorry to post this annoying simple question but it's starting to aggravate me..
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
int n, n2, n3, n4;
for (n=1;n > 0 || n < 11;n++)
{
n2 = pow(n, 2);
n3 = pow(n, 3);
n4 = pow(n, 4);
}
system("PAUSE");
return 0;
}
I keep getting errors for pow even though that's how I was taught to do it.. What am I doing wrong? And why does the C++ I'm getting taught at college seem completely different from the C++ everyone else is using.. What I mean is, why has it changed so much from 1996 (or whenever the Borland 5.01 compiler was available) to now?
Thanks
Edit: Taken some ints out of that code that I was messing about with.
Question
mark52230
Sorry to post this annoying simple question but it's starting to aggravate me..
#include <cstdio> #include <cstdlib> #include <cmath> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { int n, n2, n3, n4; for (n=1;n > 0 || n < 11;n++) { n2 = pow(n, 2); n3 = pow(n, 3); n4 = pow(n, 4); } system("PAUSE"); return 0; }I keep getting errors for pow even though that's how I was taught to do it.. What am I doing wrong? And why does the C++ I'm getting taught at college seem completely different from the C++ everyone else is using.. What I mean is, why has it changed so much from 1996 (or whenever the Borland 5.01 compiler was available) to now?
Thanks
Edit: Taken some ints out of that code that I was messing about with.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts