1
Hi,
I need to make a code inside a switch
, which reproduces all odd numbers from 0 to 200, with the repeating structure do while
. I googled and only found with for. I tried to put the "odd 200%2!= 0" inside the do, but the problem persists; keeps repeating all the numbers from 0 to 200, including the pairs. The Code is like this:
case '3': { // com problemas!!
impar0a200%2!=0;
do
{
cout<<"\n Os números a seguir são os ímpares entre 0 e 200: " <<impar0a200;
impar0a200++;
} while (impar0a200<=200);
break;
}
Very grateful. Was missing put the if, this was the main. Thank you Daniel Mendes.
– Gabriel Diniz