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

How does net neutrality protect your information? Do they connect everyone into something?

Answers

Answer:

Net neutrality law focuses on regulating and/or preventing three main practices:

Blocking: ISPs cannot block or prevent access to any lawful content on the web.

Paid prioritization: Providers cannot prioritize companies or consumers who pay a premium for a “fast lane” and keep those who don’t pay in a “slow lane.”

Throttling: Providers cannot limit your bandwidth or slow your connection based on your internet activities.

Without net neutrality or other laws protecting equal content, ISPs could, in theory, block certain websites and favor others. For example, your internet provider could theoretically make Netflix slower in order to push you towards its cable TV service.

Or, Xfinity could allow their subscribers to stream Peacock content (which they own through NBCUniversal) for free, while charging subscribers for watching Netflix. With net neutrality, you would have free and equal access to both Peacock and Netflix.

Another example would be your ISP slowing your connection every time you try to game over Twitch, but speeding it back up again when you’re not gaming, a practice known as throttling.

Explanation:

Answer: Net neutrality rules prevent this by requiring ISPs to connect users to all lawful content on the internet equally, without giving preferential treatment to certain sites or services. In the absence of net neutrality, companies can buy priority access to ISP customers.

You are replacing a wired business network with an 802.11g wireless network. You currently use Active Directory on the company network as your directory service. The new wireless network has multiple wireless access points, and you want to use WPA2 on the network. What should you do to configure the wireless network?
a. Use shared secret authentication.
b. CONFIGURE DEVICES TO RUN IN THE INFRASTRUCTURE MODE.
c. Configure devices to run in ad hoc mode.
d. Use open authentication with MAC address filtering.
e. INSTALL A RADIUS SERVER AND USE 802.1X authentication.

Answers

Answer:  Install a RADIUS server and use 802.1x authentication

Explanation:

To configure the wireless network with multiple access points and use WPA2, you should install a RADIUS server and use 802.1X authentication. The correct option is e.

What is configuration?

Configuration, in its broadest sense, describes the process of setting up or organizing anything in accordance with a given specification or needs.

Installing a RADIUS server and utilizing 802.1X authentication will enable you to configure the wireless network with numerous access points, WPA2, and other security features.

You can authenticate wireless clients based on their Active Directory credentials by using a RADIUS server and 802.1X authentication.

This will increase the wireless network's security by ensuring that only authorized users can connect to it.

Ad hoc mode, open authentication with MAC address filtering, and shared secret authentication are not advised for securing a wireless network since they offer flimsy protection and are simple to crack.

Thus, the correct option is e.

For more details regarding configuration, visit:

https://brainly.com/question/13410673

#SPJ2

what can be deployed to intercept and log network traffic passing through the network?

Answers

Answer:

Packet sniffers are protocol analyzers that can be deployed to intercept and log network traffic passing through the network.

Explanation:

en que año ocurrio otra tormenta solar que fue tres veces menos poderosa que la de 1859

Answers

Answer:

not sure but 2003

Explanation:

Which formula calculates the total value of a single row of cells across a range of columns in excel

Answers

The formula which calculates the total value of a single row of cells across a range of columns in Microsoft Excel is: =SUM(C15:Y15).

Microsoft Excel can be defined as a software program (application) that is typically designed and developed by Microsoft Inc., to avail its end users the ability to analyze and visualize spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises cells in a tabulated format (rows and columns), that are typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems through the use of Microsoft Excel.

In Microsoft Excel, the SUMIF function is a function which is used to calculate the total value of cells that meet a specific criteria such as:

Text.Dates.Numbers.

Hence, "=SUM(C15:Y15)" is a formula which can be used to calculate the total value of a single row of cells across a range of columns in Microsoft Excel.

Read more: https://brainly.com/question/24249483

Which graphic file format would you choose if you needed to make an animated graphic for a website?

Answers

Answer:

GIF – Graphics Interchange Format

Explanation:

How graphic designing
changed in years? Write in 300 words.

Answers

Answer:

Graphic design has a rich and varied history. The word “graphic design” didn’t appear on the scene until 1922, when William Dwiggins created the word to describe the art of designing with graphics. In the earliest days of graphic design, professionals drew by hand. However, in the last 60 years graphic design has forged ahead, advancing rapidly since the addition of today’s digital art tools.

Earliest Graphic Design

Even though the term wasn’t yet coined, some of the earliest designs included typography for books and newspapers. One could also argue drawings on cave walls represent a form of ancient graphics.

Fast forward to the 1900s when posters became a form of expression. During the 1940s, graphic design appeared in propaganda posters of the era, such as the “We Can Do It” poster with Rosie the Riveter. Slogans were short, to the point, and added to a graphic that set the tone.

As technology began to change and become available to more people, the entire industry that would become known as graphic design began to emerge.

The 1990s

In 1990, Photoshop 1.0 arrived on the scene. Back then, you could only use Photoshop with Macintosh computers. The birth of this new tool again changed designers’ ability to experiment with new techniques, including overlapping text, faded elements, and digital overlays.

Grunge was also born in the ’90s, which showed up in movie poster designs, book covers, and album covers with dark looking images and simple colour palettes, such as white on black, perhaps with a pop of red. A few grunge typefaces even came about—gritty and raw-looking text.

The 2000s

The 2000s began an entirely new frontier for graphic designers. In addition to tools becoming even more powerful, people were suddenly designing on portable devices, such as smartphones. On top of that, designers began to realize the importance of designing in a way that looked good across all device types.

Movement became more of a focus, with designers looking for ways to make even static logos look like they’re in motion.

One example of a logo that appears to almost be in motion is the AT&T logo of a globe. Because of the mix of blue and white along with the angles of the logo, one can imagine that the image is spinning slowly just as the earth does. They debuted the logo in 2005.

Recent Changes

There isn’t one method that dominates graphic design today, but a mix of design techniques and styles. Trends emerge from year to year—and sometimes month to month. In 2017, the use of cutout text that meshed with strong images allowed designers to create unique looks for websites and logos.

Other trends included flat icons and the addition of videos across marketing channels. Websites need to be mobile responsive more than ever before, so simplicity is the order of the day, along with speeding up overall rendering. Print advertising meshes with mobile devices, bringing a new experience to users that is more immersive.

Evolution of Graphic Design

Where graphic design will go in the future is anyone’s guess, but the user experience is sure to remain at the forefront. Designs will become more personalized and more interactive over time. One example of this type of technology and personalization appears at Walt Disney World in Orlando. As riders stroll past digital posters, a sensor picks up the signal from a magic pass armband, and the guest’s name comes up on the poster, welcoming them.

Regardless of where design goes next, expect to see increasingly more personalized designs that enhance user experience in your daily life.

Como tomar captura en laptop?

Answers

Answer: En algunas laptops o PCs basta con presionar el botón Print Screen o Impr Pant, ubicado usualmente en la parte superior derecha del teclado. Se creará la carpeta de "capturas" automáticamente en Imágenes en PNG o JPG de tu ordenador. También puedes pulsar la tecla Windows junto a la tecla Impr Pant a la vez.

Explanation:

Answer:

para windows 10, encuentras el botón de windows, shift y s

Explanation:

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

Write a code segment that will store a dinner selection in option1 based on the values of rsvp and selection. The intended behavior of the code segment is described below. If rsvp is true, the code segment should store in option1 a string indicating the person’s attendance and food choice. For example, if rsvp is true and selection is 1, the following string should be stored in option1. "Thanks for attending. You will be served beef." If rsvp is false, the following string should be stored in option1, regardless of the value of selection. "Sorry you can't make it." Write the code segment below. Your code segment should meet all specifications and conform to the examples.

Answers

The code segment illustrates the use of conditional statements.

The execution of conditional statements is dependent on the truth value of its condition.

The required code segment is as follows:

if (rsvp == true && selection = 1){

      option1 = "Thanks for attending. You will be served beef.";

}

else{

option1 = "Sorry you can't make it.";

}

The flow of the above code segment is as follows:

Check if rsvp is true and selection is 1; if yes, "Thanks for attending....." is saved in option1If otherwise, "Sorry...." is saved in option1

The code segment submitted can be used for several programming languages such as Java, C++, C and C#.

Read more about similar programs at:

https://brainly.com/question/14166674

An algorithmic solution to a problem is one in which a. a learned set of rules is used in answering the problem. b. the answer is arrived at by using the availability heuristic. c. the answer is arrived at by intuition. d. general and functional techniques are used in answering the problem.

Answers

Answer:

d

Explanation:

An algorithmic solution to any given problem is one in which is known to be a  learned set of rules is used in answering the problem.

What is Algorithmic solutions?

This is  known to be the solutions to a problem that targets how to handle a problem in a number of steps.

Therefore, An algorithmic solution to any given problem is one in which is known to be a  learned set of rules is used in answering the problem.

Learn more about algorithmic solution from

https://brainly.com/question/24953880

#SPJ6

!! please help!!

What technique is used in this code to repeat the process for each value in the array?

a. pause blocks
b. a repeat loop
c. a for loop
d. an array block​

Answers

Answer:

C: A for loop.

Explanation:

The for loop is used to repeat a section of code known number of times.

19. WHICH KEY ALLOWS YOU TO DELETE AND TYPE OVER TEXTS? *

BACKSPAACE
INSERT
CAPS LOCK
NUMBER LOCK

Answers

The answer is Backspace

Answer: backspace

Explanation:

when you use the backspace key, the text you have already typed will delete, allowing you to type new text.

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:

Provide 10 points for each question


What is Sophia (Robot) citizenship?

Why is Sophia (robot) a she and not a he

Features - what can Sophia (robots) do and not do, her limits

Public figure – why is she so popular in comparison to other robots

Events - name all events Sophia has spoken in

Controversy over hype in the scientific community – what are they

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

Provide a legend of references and link it to each paragraph (cannot use Wikipedia
as a site) – foot note each references, even if it is in your own words

Answers

Answer:

1- Saudi arabia

Explanation:

I hope your day is going well.

Answers

Answer:

using it. com the background can dramatically decrease battery life is good for

When using a voltmeter the loading effect of the meter is very much considered, where the intended resistance of the voltmeter must be very high. Why do you think it should be this way?​

Answers

Answer:

The loading effect of a dc voltmeter refers to the phenomenon in which a negative error is produced in the voltmeter reading (measured voltage), due to the low internal resistance (i.e., low sensitivity of the voltmeter).

in order to remove a slide from a presentation you should

Answers

Answer:

Right Click on the slide and press delete or the undo button if adding a slide was the last thing you did.

Explanation:

Have a splendiferous day!

Hope this helps!

Do a quick search for “The Sun”. What types of results do you see?

Answers

Answer:

What happens when you look at the Sun?

When you stare directly at the sun—or other types of bright light such as a welding torch—ultraviolet light floods your retina, literally burning the exposed tissue. Short-term damage can include sunburn of the cornea—known as solar keratitis. ... This occurs when UV light literally burns a hole in the retinal tissues.Oct

what 3 types of data can be entered in a spreadsheet

Answers

Answer:

data, labels and formulas

The three types of data that can be entered in a spreadsheet are Number data, Text data and Logical data.

We are given that;

The spreadsheet

Now,

Number data: This includes any kind of numerical values, such as integers, decimals, percentages, dates, times, or phone numbers. Number data can be used in calculations and formatted in different ways.

Text data: This includes any kind of characters, such as letters, words, sentences, or symbols. Text data is used for labels, headings, names, or other information that is not numerical.

Text data cannot be used in calculations, but can be formatted in different ways.

Logical data: This includes only two possible values: TRUE or FALSE. Logical data is usually the result of a test or comparison, such as whether a condition is met or not.

Logical data can be used in formulas and functions that involve logical operators or conditions.

Therefore, by spreadsheet the answer will be Number data, Text data and Logical data.

To learn more about spreadsheet visit;

https://brainly.com/question/31511720

#SPJ6

Explain the working principle of computer with suitable diagram.

Answers

Based on the instructions given, a computer receives data through an input unit and sends it back through an output system after it processes the data. ... Once the data is obtained, the central processing unit (CPU) takes over and processes the information it was provided along with the aid of other components.

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

HOW TO CHANGE GRADE IN SKYWARD!!

This is a way to change your grades in skyward to show your parents that you have straight A's!!

Firs go to your gradebook, then tap with two fingers on the grade you want to change then locate where it says the grade and click it until you can delete in, put in the grade you want and BOOM

Answers

Answer:

Thank you!

Explanation:

TYTYTY!

What format can be applied to text in Excel?

Answers

Answer:

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

Explanation:

If C2=20 and D2=10 what is the result of the function = mathcal I F(C2=D2,^ prime prime Ful "Open")?
Open
Unknown
Full
10​

Answers

Excel IF functions are used to test conditions.

The result of the IF function is (a) Open

The function is given as: = IF(C2 = D2, "Full","Open")

Where: C2 = 20 and D2= 10

The syntax of an Excel IF conditional statement is: = IF (Condition, value_if_true, value_if_false)

The condition is: IF C2 = D2

The values of C2 and D2 are: 20 and 10, respectively.

This means that, 20 does not equal 10.

So, the value_if_false will be the result of the condition.

In other words, the result of the IF function is (a) Open

Read more about Excel functions at:

https://brainly.com/question/10307135

What can you do in Microsoft Word 2016?

Answers

Answer:

write ?

Explanation:

Why hasn't 3D printing been more publicly used?

Answers

Answer:

Probably because it's really expensive and not well known.

Explanation:

Some metals and plastic are not able to be altered for 3D printing, which makes this harder for some people to get hold of. Most of the materials are also not able to be recycled, which makes it harder.

100 POINTSSSSSSS!!
Intellectual property laws were created because _____.

A. people have a right to their own intellectual property

B. people have no value for their own intellectual property

C. people have to get permission to own their intellectual property

D. people have to sacrifice their own intellectual property

Answers

Answer:

D

Explanation:

edg 2021

Answer:

A. people have a right to their own intellectual property

Explanation:

which of the following best describes ""compilation"" in reference to computer science?

Answers

Answer:

Compilation is a computer's process of turning high-level programming languages into easily-processable computer languages.

Explanation:

One example is of HTML. If you type

<div class="col card rounded-0 m-1 text-muted tooltipster" title="Primary #FF6C6C" style="background-color: #FF6C6C"></div>

This will create a light-red block that will show it's hex code when a user hovers their cursor over that block. However for this to work the computer must take that line of code and squish it down and then stretch it out until it's just 1's and 0's so it's easier for the computer to "digest".

Write a program in BASIC- 256 to accept two numbers from the user and print their sum and product​

Answers

10 Dim V(5)

19 rem compute the numbers

20 v(1)=rnd

30 v(2)=rnd

40 v(3)=rnd

50 v(4)=rnd

60 v(5)=rnd

69 rem compute the average

70 a=(v(1)+v(2)+v(3)+v(4)+v(5))/5

79 rem print the numbers and their average
80 print v,a

Other Questions
rearrange the following words success /a good/ best road/ education/is the/ to / in life Desperate, Will Mark Brainllest and Give Thanks for Correct AnswerWhat was James Montgomery Flaggs input towards the war? The complement of an angle is half of its size. Find the angle what is the mertis and demeteris of Ethiopia large size How to solve this question?????Help me please Find the slope of the line that passes through (-68, 47) and (-66, 33).Simplify your answer and write it as a proper fraction, improper fraction, or integer.Quick please What is meant by birta abolition? 12/164/3 divided by 5/6 Please help me out!!!!! Pleas answer this question! I don't understand this question can someone help me with this please, please explain!! and thank you for the help!! If u dont know try your best :D ILL GIVE U BRAINLIEST IF YOU DO THISWhat leadership style do you think works best with entrepreneurial leadership? Why? Which style is the worst fit? Why? Which dialogue is punctuated correctly.?A. "There WAS a frog in my bread-and-milk", he repeated.B. "How she did howl" said Nicholas cheerfully.C. "She'll soon get over that," said the so-called aunt. "It will be aglorious afternoon!" 2. Write brieflythe key objectives of Early childhood care and education (ECC). In science, the term theory is applied only to ideas that are supported by a vast, diverse array of evidence. How is the term used in everyday life? 1Imagine you are an Incan living during the 1400's and you want to record what life was life for future generations to read. Write about what a typical day in your life looked like. Be sure to include elements of culture (language, activities, clothing, food, buildings, etc..) and the physical geography (landforms). Give as much detail as you can in at least 5 sentences. What is the quotient of 6.591 times 10^7 6 and 8.45 times 10^2 expressed in scientific notation? Plz help I need help True or False, The American Slaveswould have been better off if Americastayed BritishTrue False The Declaration of Independence best demonstrates which ideal of theEnlightenmentProtection of minority rightsO Social contract theoryO The Magna CartaSeparation of powers