hello, First Time here. i dont know what to say but i have a problem. i am doing a program that is showing odd numbers using three cycles, for, while and do-while. ive managed to show the odd numbers in while and do while, but it only starts at the numer 7 on the for cycle, i want it to show staring from the first number (in this case 1), is there any way i can make it start at number 1. sorry if my english is bad, im from mexico.
Like rexorzz it worked for me in Visual Studio. I believe what has happened is after all three loops have run you have to many lines in your display to scroll back to the very first line. Try putting a pause after the first two loops and see what happens when you scroll back.
Hi Handy Andy,
i tried what you said and it works, but i want the program to run all the cycles, i tried chaning the order of it and the same problem is still happening.
edit: I tried taking only the Do While Cycle to run on its own and it works, and the other programs runs fine with For and while, so i think theres a problem with the Do while Cycle. is there any way i can put the three of them together?
hello Student Of Jack,
im trying to create a program with c++ using three cycles (Do while, For and While). as ive said earlier, i took The Do while Cycle out of the program to run on its own, and it works, but i want it to run all three cycles in the same program. hope i answered your question.
De acuerdo, de recibir una prueba para el lazo y funciona! Ahora vamos a verificar si se trata de la consola o del programa que es el problema. Poner su tiempo y do-while bucle de vuelta en su código fuente y ver si el problema vuelve a aparecer. Si lo hace, entonces sabemos que es la consola, y necesitamos cambiar el tamaño del búfer para que podamos ver toda la producción. Si el problema no vuelve a aparecer, entonces yo soy sólo pasmado ...
Basically, lets test the program again with the three loops all in your source code and see if the Windows console is messing with us.
Maybe you misunderstood what I meant about the pause. The lines with comments is all I added to your program. This allows each loop to do its work and pause before the next loop runs. All three can be in the same program yet run separately of each other.