// Pantea Aria // read 10 ints, find the number of odds // example: 20, 45, 56, 87, 90, -4, 0, -99, // print out 3 #include #define MAX 10 int main(void) { // because you know how many times your want to repeat scanf // you need a loop with a // declare your counter int counter = 0; // declare a variable for your number int number; // because you want to count how many odds you have // you need another counter // declare a counter for the number of odds int odds = 0; printf ("Enter 10 integers: "); while (counter < MAX) { scanf ("%d",&number); // check if that number is odd if (number % 2 != 0) { odds = odds + 1; } counter = counter + 1; } printf ("We have %d odd numbers\n", odds); return 0; }