Where should I fit the accumulators of this code I wrote for now?
#include <stdio.h>
int main()
{
int N;
int somapar;
int somaimpar;
do{
printf("\n Digite um número qualquer: ");
scanf("%d", &N);
if (N % 2 == 0){
printf("\n Número escolhido é par!");
}
else {
printf("\n Número escolhido é ímpar");
}
}while (N >= 0);
printf("\n");
return 0;
}
The algorithm statement is this:
Write an algorithm to show on the screen whether each N number, typed by the user is even or odd. The algorithm should also show on the screen the sum of all even numbers, the sum of all odd numbers, the percentage of even numbers and the percentage of odd numbers entered. The algorithm should terminate its execution if the user types a number less than zero.