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

Answers

Answer 1

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.


Related Questions

please answer it is important!!!! i will mark you branliest

Answers

Answer:

Machine - consists of the numeric codes for the operations that a particular computer can execute directly

Assembly - provides the information of any error in the code.

High level - Require translation.

Require translation.Portable.

Require translation.Portable.Easier to read, write and maintain as commands are similar to English.

Require translation.Portable.Easier to read, write and maintain as commands are similar to English.Allow access to module libraries.

Objectives ** WILL GIVE BRAINIST PLEASE**
Write a scientific report modeling a written research paper on big data applications.



Your Task

Think of an area that interests you: sports, arts, entertainment, international relief efforts, government, careers, or the weather.


Think of a question you would like to answer. Is it better to wait until the battery is low before you recharge your smartphone? How does a streaming service like Netflix or Hulu decide which shows to offer?


Look for a website where someone already collected a large quantity of data to answer that question. While commercial big data sets may have tens of thousands of values, for this project, look for a data set with at least 100 values.


You are not going to write a program to analyze these data because you have not yet covered how to read data files. You can describe how the researcher(s) who collected the data used them to answer your question.

Your Document Requirements
Part 1: Name
Your name
Names of your partner(s) (include the names of your group if this is a group project)
Part 2: Title
Part 3: Question(s) to Answer
A paragraph that introduces your topic and the question(s) to be answered
Part 4: Exposition
Describe the data you found, including a link to the page
Explain the answer to your question(s)
Give credit to your sources, whether using direct quotes or not
Part 5: Conclusion
A paragraph summarizing your analysis
Part 6: Bibliography
Part 7: Partner Participation (only included for those working in groups)
Describe the role and responsibilities of each member of the group

Answers

Answer:

                                                                                                                 (name)

Explanation:                              Title

Question(s)A paragraph that introduces your topic

Direction: Write True on the line if the statement is correct. Write False if the statement is incorrect. 1. All objects are composed of shapes and all other design elements are shapes in some way. 2. The color is the basic tool for combining colors. 3. Red violet and blue green are examples of tertiary colors. 4. The arrangement of furniture on each side of a dominant point is referred to as radial balance. 5. Color is the way one feels or perceives about a surface.​

Answers

ANSWER:

TRUEFALSEFALSETRUETRUE_________________

CARRY ON LEARNING

CAN YOU BRAINLEST ME PLEASE

Answer:

1. False coz colour isnt a shape

2. True

3. True

4. True, I think

5. Can be true

Explanation:

ASAP! WILL MARK BRAINLIEST + 100 POINTS!!

Match each word to its description.

Answers

Answer:

Windows- operating system most commonly used by businesses

Spreadsheet, word processing- types of application software

data- type of file created when word processing document is saved

system calls- instructions for the OS provided by application software

documents- folder where documents you create go by default

Recycle Bin- where documents go when you delete them.

toggling- switching from one setting to another

Help menu- best place to get assistance in a word-processing program

I hope this helps, please let me know if any are incorrect.

this device enables connectivity between two lans or a lan and a larger network.

Answers

Answer:

I'm pretty sure it's a cable. A lan cable specifically.

Explanation:

1. Which of the following deals with the aspects of health and safety in the workplace? A. Mental health B. Occupational health C. Physical health D. Psychosocial health 2. It pertains to an event that may cause harm to an individual, such as chemicals, electricity, open drawers, and inadequate ventilation. A. Disease B. Disorder C. Hazard D. Risk 3. What refers to the possibility of being exposed to dangers, harm, or loss? A. Disease B. Disorder C. Hazard D. Risk 4. What hazard comes from exposure to animals, people, or infectious materials? A. Biological B. Chemical C. Physical D. Psychological 5. Which of the following is NOT an effect of chemical hazards? A. Allergic reactions B. Low self-esteem C. Skin irritation D. Skin or eye burns 6. Which of the following is a life-threatening effect of a psychological hazard? A. Depression B. Deterioration of performance C. Loss of concentration at work D. Loss of self-confidence​

Answers

Answer:

1. C

2. C

3. D

4. A

5. B

6. A, B, or C either one might happen

Explanation:

what is the type of software that locks your device until you pay a hacker to gain access again?

Answers

I’m not 100% sure, but I think it is Malware

What is wrong with the following code? publicstatic char grade(int score) { if (score >= 9) { return 'A'; } else if (score >= 8) { return 'B'; } else if (score >= 6) { return 'C'; } else if (score > 4) { return 'D'; } else if (score < 4) { return 'F'; } }

Answers

Answer:

c) No return statement for all possible logic paths

60 POINTS
Complete the sentence.
When we use the internet, our personal information becomes ________.
A. public
B. accessible
C. private

Answers

Answer:

Answer should be accessible .

Answer:

accessible

Explanation:

got it right on edge

how to prevent truncation of data when importing into sas studio

Answers

Answer:

Set the length BEFORE pulling the dataset. You cannot change the length of character variable after it has already been set. Then remove any format that might be attached to it. In fact why not just remove any formats attached to any of your character variables.

what is the correct keyboard shortcut to cut a cell value

Answers

Answer:

Cntrl+X

Explanation:

Do it on your computer

The keyboard shortcut to cut a cell value is Ctrl +X.

What is Ctrl X?

Control x can be written as ctrl x

To cut a text means to remove the text from where it was initially and retain the ability to paste the cut text in a desired cell.To do this, we use the cut function which is ctrl x. This cuts the text while ctrl v would paste the text in the desired location.The shortcut ctrl x can be clearly described as the action removes the text or item and stores it in the clipboard, rather than copying it to the clipboard.

For example, you can cut a picture out of the beginning of a Word document and paste it further down within your document. Alternatively, you can cut a block of text out of Word and paste it onto a PowerPoint slide.

So, the keyboard shortcut to cut a cell value is Ctrl +X.

Learn more about ctrl x,

https://brainly.com/question/14447287

#SPJ6

what maintains data about various types of objects, events, people, and places?

Answers

Database,A data made management system,data element,

There are numerous components that maintain data about various types of objects, events, people, and places. They are known as databases, data management systems, and data elements.

What do you mean by Database?

A database may be defined as a systematic collection of data that is significantly stored and accessed electronically by a user. After storage, it can be retrieved or extracted when the user requires it for their need. It holds a complete set of files, folders, documents, etc. in an organized manner.

Apart from databases, data management systems are the framework system for gathering and interpreting large volumes of data across an organization in a sequential manner. It basically includes software tools for its proper management.

A data element is a fundamental unit of data that has some precise meaning and functional property in order to classify data on the basis of some criteria or characteristics.

Therefore, there are numerous components that maintain data about various types of objects, events, people, and places. They are known as databases, data management systems, and data elements.

To learn more about Databases, refer to the link:

https://brainly.com/question/518894

#SPJ6

describe how you would open a new open word processing document

Answers

Answer:

open the program by clicking on the icon or finding it in your program. Once you have opened it you can either use the blank page that has opened or you can go to the file tab and click new word document or new document.

Explanation:

What format can be applied to text in Excel?

Answers

Answer:

You can apply accounting format,date,numbers, currency, percentage or even fraction

Explanation:

resolution of bitmap graphics is typically measured in

Answers

Answer:

Pixels

Explanation:

The resolution of bitmap graphics is said to be measured in DPI (dots per inch).

What is the measurement  about?

The unit of measurement is often used to tell more about  the resolution of images and it is known to be called DPI (dots per inch).

Therefore, in the above case, The resolution of bitmap graphics is said to be measured in DPI (dots per inch).

Learn more about bitmap from

https://brainly.com/question/21449716

#SPJ6

Range is an example of a ______________.
PLZ help!!!

Answers

Answer:

Function

Explanation:

In python, they use this word a lot.

The function in Python is an example of just one. Whenever called, the reach function accepts one argument. This range function accepts up to 3 arguments, but at least one must be specified when this is invoked.

It provides a process called range(). It returns a series of numbers that starts at zero and increments by one by default, stopping before the defined set.This function is most commonly used to iterate sequence types (Python range () list, string, and so on) using for and while loops.In the for loop, one of the most common uses of the range () method is to iterate through a series of variables.

Therefore, the final answer is "Function".

Learn more:

brainly.com/question/22291227

Using robots to replace workers in factories is an example of which of the following forms of information processing systems? a. Commercial b. Control c. Scientific d. Industrial​

Answers

Answer:

Industrial Robots

Explanation:

They are considered industrial robots because the word industrial has to do with an industry or a factory.

Also, industrial robots will replace the human workers

Hope this Helps

To free up human power for more difficult jobs, they are easily used to finish boring, repetitive, and physically taxing chores. This means that many low-skilled positions, like those in warehouses and on assembly lines, will be replaced by robots, endangering the employment of many low-skilled humans. Thus, option D is correct.

What using robots to replace workers in factories?

Labour automation is the process of using technology instead of people to carry out particular tasks or jobs. Mechanization is a component of automation, but it also entails expanding it by using technology to further dehumanize work.

An automated conveyor would transport the product being manufactured from one stationary worker to the next until it was fully assembled, replacing the previous approach in which employees transported their pieces to a stationary assembly site.

Therefore, using robots to replace workers in factories is an example of Industrial forms of information processing systems.

Learn more about robots here:

https://brainly.com/question/15561225

#SPJ2

what the answer is have been stuck for 4 hours on this questoin its sience

Answers

Answer:

what the question?

Explanation:

After completing a career search, Patrick has decided that he wants to be a paralegal. Which two skills or abilities are important for him to have in order to excel in this career?
research skills
analytical thinking skills
creative thinking skills
math skills

Answers

Answer:

Research skills & Analytical thinking skills

Answer:

Research skills & Analytical thinking skills

Explanation:

Crazy Sentence Program. Create a program that prompts the user for the name of an animal, a color, the name of a vehicle, and the name of a city. Then print a sentence that contains the user input in the following order. Include the additional words in the sample output as part of your output. Example: Assume the user enters the words: tiger, green, motorcycle, and Wildwood. The output would be: The green tiger drove the motorcycle to Wildwood.

Answers

I agree with you ✔✔✔

which hardware component interprets and carries out

Answers

Answer:

The processor, are also called a CPU(central processing unit) is an electronic component. That interpretes and carried out the basic instruction that operates a computer

Explanation:

18. WHICH MENU WOULD MOST LIKELY ALLOW YOU TO ADJUST YOUR LINE SPACING? *

EDIT
FILE
F0RMAT
INSERT

Answers

Explanation:

FORMAT

because it is used for the general appearance of the page

who want to play quzzies the code is 124 3142

Answers

Answer:

22

Explanation:

11+11=22

heyyyyyy who likes anime​

Answers

Answer:

You apparently

Explanation:

Answer:

I don't like anime I love it

what is the term used to describe image file that contains multiple small graphics?

Answers

The answer sir should be Sprite

What is your opinion about Sophia, just a robot or human robot (explain your answer
with merits

Answers

Who’s Sophia and pls give more context
I’m sorry I don’t know who Sofia is

HELPPP PLEASE

Html can be used to create complicated mobile applications
True or false

Answers

it might be true because it’s technically a programming language so having knowledge on it can help you create mobile applications

Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the number of seeds in each flower pot

Answers

Answer: in solution.

Explanation:

It is basically 194 divided by 11 since we are evenly grouping 194 seeds into 11 pots. This gives 17.636363…

This means that the best estimate is around that number.

What are the advantages and disadvantages of working with APIs when developing applications?

Answers

Answer:

Disadvantage:-There is a lot of conveniences and advantages to APIs, but business leaders should also be aware of the disadvantages. As a single point of entry, an API is a gateway and can become a hacker's primary target. Once the API is compromised, all other applications and systems become vulnerable.

Nine of the top ten vulnerabilities listed in the OWASP Top 10 now mention APIs — and since APIs can be accessed over the internet, they will have all the same disadvantages as any other Internet-based resource.  APIs are vulnerable to man-in-the-middle attacks, CSRF attacks, XSS attacks, SQL injection, and DDoS attacks.

ADVANTAGE:- Automation: with APIs, computers rather than people can manage the work. Through APIs, agencies can update work flows to make them quicker and more productive

Explanation:

pLEASE MAKE ME AN BRAINLAEIST

I was correcting my keyboard since the arrows had a qwerty swap, but I looked at the settings and realized I needed to change it, but I deleted the keyboard file and my keyboard stopped working, so I panicked. I'd be dead if my father saw the keyboard. What do i need to reinstall it?,,,

Answers

Answer:

Hi,

Try this link

https://certified.windowserrorhelp.com/automatically-update-device-drivers/?headline=%20Keyboard%20Drivers&logo=keyboard&gclid=CjwKCAjw5c6LBhBdEiwAP9ejG1lZr9EYilcRFp3KfYydybYMNfbWAC9-1cwynalo6vDN9R7D452qORoCC9cQAvD_BwE

Then download the thing.I promise it is secure.

Explanation:

It helps reinstall and install driver updates for windows computers. Based on the way you talked about your keyboard it seems like you have a laptop.  The link above will help you re-install and automatically update your keyboard driver. If you have a Mac or other Apple Computer you didn't delete it because Apple hardware has non-removable Drivers for their laptops. in this case there is probably a 3 party source affecting this, such as, heaven forbid, a virus, a corruption of internal storage, or a short circuit.

Other Questions
Is each number correctly expressed in scientific notation? Choose Yes or No.Number Scientific Notation 4,836,000,000 4.836 106 Choose...0.0000005812 5.812 107 Choose...546,000,000,000 5.46 1011 Choose... An area that has the power to make, implement, and enforcelaws ABC is similar to DEF. The length of segment AC is 12 cm. The length of segment BC is 18 cm. The length of segment DF is 10 cm. What is the length of segment EF?Question 1 options:1514109 A truck can be rented from Company A for $110 a day plus $0.50 per mile. Company B charges $80 a day plus $0.75 per mile to rent the same truck. Part A: Write an equation to find the number of miles in a day at which the rental costs for Company A and Company B are the same. Part B: Solve the equation. I dont get this at all help.? Simplify.15 20 24+20 What groups of people did the Europeans force to work as slaves in the New World?criminals from the Old World 8x - 8 - x = 3 (6 - 2x) Hookes Law for an elastic spring states that the distance a spring stretches varies directly as the force applied. If a force of 180 newtons stretches a spring 5 cm, how much will a force of 270 newtons stretch the same spring? need an answer quick!!biowill give brainliest to correct answerer how does forward spatter compare to impact spatter WHY 19/20? I think 19-20/(19+20)/2 I should have been __________ of my condition.A) tollB) toilC) toldD) tolledAidan was so hungry that he __________ his tuna sandwich so quickly. A) took outB) picked upC) turned overD) wolfed down how would a rock respond to stresses applied at depth? convert 11.5kg into grams 20 POINTS !!!!!!!!! Solve the quadratic equation by completing the square.x^2 - 18x + 68 = 0First, choose the appropriate form and fill in the blanks with the correct numbers.Then, solve the equation. Round your answer to the nearest hundredth.If there is more than one solution, separate them with commas. help please? The janitor at a school discovered a leak in a pipe. The janitor found that it was leaking at a rate of 13 fl oz per hour. How fast was the pipe leaking in gallons per day? !!!is my answer correct??pls see!! Jenna is having her birthday party at the ice cream palace. The ice cream party palace charged 2.49 for each ice cream cone and 24.99 for a birthday cake Jenna decides to buy a birthday cake and an ice cream cone for each of her friends. Jenna needs to determine the total cost for her birthday party. DESPERATE!! WILL GIVE BRAINLIST FOR RIGHT ANWSER,What was the Martinsburg Strike about?