My variables are:
int codigo; --> Sendo esta variável para o switch
int numero1,numero2,numero3;
The user will enter three variables:
printf("Digite o primeiro numero inteiro: ");
scanf("%d", &numero1);
printf("Digite o segundo numero inteiro: ");
scanf("%d",&numero2);
printf("Digite o terceiro numero inteiro: ");
scanf ("%d", &numero3);
After this, I need to make the program check on each variable, what are its even and odd numbers.
For example, the user in the first variable named numero1
type número 20
, with this, the program will have to go through to número 20
and show which numbers were even and odd.
After the user types in the variable numero2
, the número 19
, and again the previous check will be done.
Finally, the user types in the variable numero3
, the número 30
and again the same check.
I'm using a switch because the user will have other options as well. But how can I do this then? Using a for
along with a do-while
until you can get all the numbers and check which ones are odd and even?