1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Bezzdna [24]
2 years ago
15

Program to count how many even and odd number are in the range from M to N using C++ programming language

Computers and Technology
1 answer:
NemiM [27]2 years ago
8 0

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: <em>min</em> and <em>max</em>). We declare another variable (<em>number</em>) and store in it the lowest number of the range (<em>min</em>). To check whether the number currently stored as the value of the variable (<em>number</em>) 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.

You might be interested in
With respect to PERT and​ CPM, slack A. is a task or subproject that must be completed. B. marks the start or completion of a ta
Wewaii [24]

Answer:

The correct answer is C) With respect to PERT and​ CPM, slack is the amount of time a task may be delayed without changing the overall project completion time.

Explanation:

The CPM (Critical Path Method) method is frequently used in the development and control of projects whose tasks have a fixed duration while the PERT (Program Evaluation and Review Techniques) method is a set of techniques with the same purpose but that allows to work with tasks with estimated probability duration but not deterministic.

Both methods are based on developing a complete scheme that includes all the tasks of a project linked to each other according to their sequence, determining the duration and analyzing different ways of reconfiguring the task planning to optimize the use of the resources of according to the general objectives of the project.

There are tasks that to start performing them must have been completed one or more previous tasks. The overall duration of the project is determined by the Critical Path, which is the sequence of tasks of greater duration. The tasks belonging to the critical path have to be carried out with special care because delays in them would cause delays in the total achievement of the project. That is why these tasks have no slack.

The rest of the tasks have some slack, which is determined by the time that a previous task can be delayed without delaying the total time of completion of the project, that is, not exceeding the duration determined by the critical path.

That is that why we say that the <em>slack</em><em> is the amount of time a task may be delayed without changing the overall project completion time</em>.

8 0
3 years ago
To draw a clustered cylinder chart, first select the data to be charted and then click the column button (insert tab | charts gr
d1i1m1o1n [39]
It is true that to <span>draw a clustered cylinder chart, first select the data to be charted and then click the column button (insert tab | charts group).</span>
5 0
3 years ago
How can you make the drawing tools contextual tab appear
Anestetic [448]

Answer:

Following up on Stefan's repsonse, this means that first, from the Insert tab you need to insert a line or shape. Once you've inserted something, select it and the contextual tab DRAWING TOOLS - FORMAT will appear.

Explanation:

3 0
2 years ago
Read 2 more answers
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
What is redundancy? What problems are associated with redundancy?
Anarel [89]

Answer:

Redundancy is the mechanism that occurs in database's data as the same data is stores in the multiple location.It creates repeated data by accident or for backup purpose.

The issues that arise due to the redundancy of the data is the storage space in database gets consumed and thus wastes the space in storing information in multiple locations.When any update occurs in the stored data's field value , it also has to be changed in the multiples occurrences.

5 0
3 years ago
Other questions:
  • A(n) _____ can be used to convert digitized documents into ascii (american standard code for information interchange) text that
    6·1 answer
  • If given the chance to own manage a business,what will be the name of the business?
    11·2 answers
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • What are three sections in a work sheet accounting
    12·1 answer
  • Cmo se puede añadir amigo ??'
    12·1 answer
  • I need help <br> with a question<br> what can i write for ex when he mad
    13·2 answers
  • How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
    9·1 answer
  • What is the difference between algorithm and program?
    10·1 answer
  • How can I call moderator in braily app ???
    5·1 answer
  • Write code that declares a variable named minutes, which holds minutes worked on a job,
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!