Where's the problem in my simple code?

My compiler tells me there's an error in the 24th line: "invalid suffix on "x" on integer constant". I don't know what that means.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>

using namespace std;

int raise(int base, int power) {
    int temp;
    temp=base;
    int i;
    if (power==0)
        return 1;
    if (base==0)
        return 0;
    if (power==1)
        return base;
    for (i=2;i<=power;i++)
        base=base*temp;
    return base;
}
int main()
{
    int x,y;
    for (x=0;x<1000;x++)
        for (y=0;y<1000;y++)
            if (raise(x,3)-5x+10==raise(2,y))
                cout << x << " " << y << endl;
    return 0;
}
I think you mean 5*x where you have 5x?
5x is incorrect in this context, you need to specify multiplication operator i.e 5*x
Topic archived. No new replies allowed.