What's the error? Something's wrong with my dev C compiler, so I can't even compile.

And do you even need all those references?

Edited 3 Years Ago by scudzilla

Yeah, the problem's on my end. I can't compile any Cs or Cpps. Which is why I was asking OP what the error is.

@ tinstaafl it is also working fine on my dev-c++ but why it giving RTE on ideone?

Edited 3 Years Ago by shanki himanshu

@ tinstaafl it is also working fine on my dev-c++ but why it giving RTE on ideone?

I suspect you're not giving the Ideone sufficient input to work with. Click the "upload with new input" button and add this:

5 1 2 3 4 5

There should be no errors and the output will be:

3
9
27
81
243

Edited 3 Years Ago by deceptikon

@deceptikon i also think so but i remember a lot of times i got 'success' without any i/p.

Edited 3 Years Ago by shanki himanshu

In those cases either the program didn't expect input, or your code used reasonable default values. Did you try what I suggested?

@deceptikon i have given i/p yesterday and it works .
and yes,you are right. i declared 'n' aand 'k' global and i got success.
thanks.

i declared 'n' aand 'k' global and i got success.

That means they're defaulted to 0 instead of given some random value.

This question has already been answered. Start a new discussion instead.