what are the problems in this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what are the problems in this code

https://www.sololearn.com/compiler-playground/cukwfW0di75A this is my code i want it to print out all the numbers between 1 to 255 but this program stops in the first itteration

8th Aug 2023, 1:14 PM
Faran Allah Verdi
Faran Allah Verdi - avatar
3 Answers
8th Aug 2023, 1:20 PM
BroFar
BroFar - avatar
+ 1
If your only aim is to print every number, you're overcomplicating the code. Use a for loop from 1 to 255 included and use 'cout' to print each in the body of the loop. But my guess is that that is not what you really want, so maybe try explaining further if possible.
8th Aug 2023, 1:53 PM
Marcos Chamosa Rodríguez
Marcos Chamosa Rodríguez - avatar
0
you are right I just understood that I was missing the division
8th Aug 2023, 1:57 PM
Faran Allah Verdi
Faran Allah Verdi - avatar