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
Suppose we used an Internet Addressing protocol that used 4 bits to encode a single address. How many devices would be supported
Allushta [10]
C. is the answer my guy
8 0
3 years ago
(Drag each tile to the correct box)While surfing online, Patricia first checks her email and reads the latest messages. She then
Marizza181 [45]

Answer:

When Patricia checks her email use:

POP3

TCP

IP

When Patricia brows a website and log in to post a comment use:

HTTP

TCP

IP

LDAP

Explanation:

Email protocol

Patricia starts to check her email, the email application uses the protocol POP3.

The protocol TCP makes a connection with the server and transport the data.

Patricia receives her emails with the protocol IP on her computer.

Website protocol

Patricia started to surf and the protocol HTTP makes a connection with the internet.

The protocol TCP makes a connection with the server and transport the data.

With the protocol IP, she receives the website data.

With the protocol LDAP, Patricia makes a login to post the comment.

6 0
3 years ago
Which of the following scenarios describes an IT professional using the Internet and computer system access in an unprofessional
pantera1 [17]

Answer:

All of the above

Explanation:

6 0
2 years ago
How do I write a good personal narrative pls help im struggling very hard rn.​
statuscvo [17]

Answer: Find out which starter makes your partner most interested in reading your story.

1. Start with action or dialogue.

2. Ask a question or set of questions.

3. Describe the setting so readers can imagine it.

4. Give background information that will interest readers.

5. Introduce yourself to readers in a surprising way.

Explanation:

4 0
3 years ago
How do you fix peer answer bad gateway 502. Please help
kondaur [170]

Answer:

Reload the page.

Look for server connectivity issues.

Check for any DNS changes.

Sift through your logs.

Fix faulty firewall configurations.

Comb through your website's code to find bugs.

Contact your host.

Explanation:

7 0
3 years ago
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n)
    10·2 answers
  • what properties are associated with all Microsoft Office files and include author, title, and subject
    5·1 answer
  • Debugging is not testing, but always occurs as a consequence of testing. <br> A) TRUE<br> B) FALSE
    13·1 answer
  • 1. Mobile devices have a _________ viewport that displays a web page content that fits within a mobile screen.
    11·1 answer
  • The chemical symbol H represents which of the following elements?
    9·2 answers
  • What to do when you strip a screw
    10·2 answers
  • How can i clear the CMOS​
    6·1 answer
  • Erewrxdnnefwn q wedsvd
    6·1 answer
  • In order to personalize your desktop, you may click on: Start&gt;settings&gt;Personalization . . .
    9·1 answer
  • NAT addresses concerns over the dwindling IPv4 address space by ___________________. 1 point allowing networks to use fewer IP a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!