So I'm trying to get a simple program to work by asking the user to enter numbers within 1-100 and have the program store everything entered then tell the user later on all the numbers and how much it adds up to be.
Right now all I want to know is how do I store the variables and have the program be able to tell me how many numbers were entered.
Should I make a function outside of main that does the processing for storing and adding?
#include <stdio.h>
int main () {
int number, even, odd;
char name;
printf("Enter your name")
scanf(%d, &number);
scanf (%c, &char)
printf("Enter numbers within 1-100")
printf("Enter 0 to quit")
while (number != 0) {
if (number%2 == 1) {
//This is where I don't know how to store the odd numbers
}
else {
//And the even numbers here as well
}
}
printf("%c,the numbers you have entered are broken down as follows:\n",name);
printf("You entered %d even numbers with a total value of \n", even);
printf("You entered %d odd numbers with a total value of \n", odd);
return 0;
}