can you help me please?

This is a discussion on can you help me please? within the C++ Programming forums, part of the General Programming Boards category; I know i should not but i'm gonna add the source code any ways.
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
...

Take for example the first line. If counter > 0 and counter >= 10. If counter >= 10, then automatically counter > 0. Isn't it? So it would suffice if counter > 0..... but assume counter == 31. Then counter > 0!! So when counter > 0, then your program will ALWAYS go in the line file[1]='t'.

By the way, don't use that while (1). I, personally, would never use while (1) in a program like this.

You know that the program should break the loop when counter > 30. Knowing this condition it would be better to it this way:

Code:

while (counter++ <= 30)

The last thing you need to change is the range checking. I assume you want to do this: