0
What is wrong whit this code(this code is for x^j)?
#include <iostream> using namespace std; int main() { int x,j,i=1; cin >> x; cin>>j; if(i<=j,i++) { x*=2; } else { cout<<"power is "<<x; } return 0; }
3 Respuestas
+ 6
Syntax error on if statement, there is nothing like if(i<=j, j++)
+ 1
The if and onwards, its all wrong
for(;i<=j;i++)
{
x*=x;
}
cout<<"power is"<<x;
0
tnx my frinds