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]
3 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]3 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
Check your tire pressure every _____. A. month B. two months C. six months D. year
ohaa [14]

Answer: I'd say (B) Two months

Explanation: Hope its correct and helps, Good luck :)

6 0
4 years ago
Read 2 more answers
Provide an example by creating a short story or explanation of an instance where availability would be broken.
ryzh [129]

Incomplete/Incorrect question:

Provide an example by creating a short story or explanation of an instance where confidentiality would be broken.​

<u>Explanation:</u>

Note, the term confidentiality refers to a state or relationship between two parties in which private information is kept secret and not disclosed by those who are part of that relationship. Confidentiality is broken when this restricted information is disclosed to others without the consent of others.

For instance, a Doctor begins to share the health information of a patient (eg a popular celebrity, etc) with others such as his family members and friend

s without the consent of the celebrity.

6 0
3 years ago
What will be the output of the statement?<br> System.out.println(2*4*(8+3)-9%7);
Lapatulllka [165]

Answer:

87.37

Explanation:

(2*4*(8+3)-9%7)

(8*(8+3)-9%7)

8*(11)-9%7

88-8%7

88-0.63

87.3

7 0
4 years ago
Which one of these statements about digital signatures is true? A digital signature:
lbvjy [14]

Answer:

<h3>A. Is used to add a personal touch to e-mail messages.</h3>

Explanation:

<h3>A digital signature—a type of electronic signature—is a mathematical algorithm routinely used to validate the authenticity and integrity of a message (e.g., an email, a credit card transaction, or a digital document). ... Digital signatures are significantly more secure than other forms of electronic signatures.</h3>

4 0
3 years ago
Please help!! Where can you look to see how fast the browser is downloading a webpage?
Naily [24]

Answer:

I believe the progress bar

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Why is Market Equilibrium unique and important?
    13·1 answer
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphAndMinutesToMiles(). Origi
    6·2 answers
  • An___ is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
    5·1 answer
  • Complete the steps to evaluate the following
    13·2 answers
  • An alarm clock draws 0.5 A of current when connected to a 120 volt circuit. Calculate its resistance.
    10·1 answer
  • A student wrote a song. Another student posted a video of the song on You Tube, claiming to have written the song. This is most
    15·1 answer
  • ______ provide visual representations of the options available for a given command
    7·1 answer
  • How to resize an image in photoshop without losing quality.
    11·1 answer
  • The process of specifying that certain rows be displayed in the results of a query is known as selection. ______________________
    13·1 answer
  • Element of python which is valid syntax patterns
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!