Respuesta :

mdshyk

Answer:

#include<stdio.h>

#include <iostream>

using namespace std;

 

int main(){

   int number, min, max;

   cout << "Enter the minimum range: ";

   cin >> min;

  cout << "Enter the maximum range: ";

   cin >> max;

   cout << "Odd numbers in given range are: ";

   for(number = min; number <= max; number++)

        if(number % 2 !=0)

            cout << number<< " ";

   cout<< "Even numbers in given range are: ";

   for(number = min; number <= max; number++)

        if(number % 2 ==0)

            cout << number << " ";

 

   return 0;

}

Explanation:

First of all, we take declare two variables. one as the lowest number of the range and the other as the upper limit of the range (in this case: min and max). We declare another variable (number) and store in it the lowest number of the range (min). To check whether the number currently stored as the value of the variable (number) is even, we take in account the remainder of that number divided by 2. If the remainder does not equals 0, we print that number as odd. We again check the remainder by dividing the number by 2. If the remainder does equals 0, we print that number as even.