Um.
What do you expect that code to do?
You read a "random number" from the user - which is a strange idea to start with - and if it's outside the limits (that you didn't tell him) you print a message, but continue to use it anyway...
Otherwise, you write all the numbers from that value up to 500 inclusive and continue anyway.
Regardless of what you printed earlier, you set
c
to three by a convoluted method, and then assume that pi is 0.024, add one to it, and print
N : 500
C : 3
Pi: 1.024
I know this is probably your homework, but you need to throw that away, sit down, and try to work out exactly what you are supposed to be doing here - because that isn't even close to what you teacher asked for! :laugh: