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
elena55 [62]
3 years ago
5

Write a program segment with a do-while loop that displays whether a user-entered integer is even or odd. The code should then a

sk the user if he or she wants to test another number. The loop should repeat as long as the user enters 'Y' or 'y' . Use a logical OR operator in the do-while loop test expression
Computers and Technology
1 answer:
Leya [2.2K]3 years ago
5 0

Answer:

Following is the program in C++ program

#include<iostream> // header file

using namespace std; // namespace  

int main() // main function  

{

int num1 = 0; // variable declaration  

char test;// variable declaration  

do

{

cout << " Enter the number: ";

cin >> num1; //Read the input by the user  

if (num1 % 2 == 0) // check the condition of even

cout << " number is even.\n";

else // check the condition of odd

cout << "Number is odd.\n";

cout << " Do you wanted the another test of number (y/n)? ";

cin >> test; //Read the input by user

} while (test == 'y' || test == 'Y'); //terating the loop

return 0;    

}

Output:

Enter the number:45

number is even.

Do you wanted the another test of number (y/n) Y

Enter the number:5

Number is odd.

Do you wanted the another test of number (y/n) n

Explanation:

Following are the description of program

  • Declared a variable "num1" as integer type and initialized as 0 to them
  • Declared a variable "test" as char type .
  • After that iterating the do -while loop .Read the value by the user in the "num1" variable .
  • Check the condition of even and odd by using % operator .
  • Read the value of test by the user .If the user enter Y or y then loop again executing otherwise not .
You might be interested in
Top/Bottom Rules allow a user to apply conditional formatting to cells that fall within the top or bottom numbers or percentile.
vfiekz [6]

The numbers of  items that the user can include in the rule is the top or bottom 100 items only.

<h3>What is Top/Bottom Rules?</h3>

Top/Bottom Rules is known to be a rule where there is a premade form of conditional formatting which is often used in Excel to alter the set up  of cells in a range.

Note that the Top/Bottom Rules will allow a user to make changes to the top or bottom 100 items only as it only pertains to things that are up and those that are at the bottom.

Learn more about Top/Bottom Rules from

brainly.com/question/1862654

7 0
2 years ago
a circuit has an inductor with an inductive reactance of 230 ohms. this inductor is in series with a 500 ohm resistor. if the so
Amanda [17]

Answer: attached below

Explanation:

8 0
3 years ago
The ________ is responsible for the Internet's domain name system and the allocation of IP addresses. ICANN W3C ISOC IAB
Maurinko [17]

Answer:

ICANN

Explanation:

It handles the installation and processing of various databases related to network domains and provides a consistent and secure networking service and there are incorrect options are described as follows:

  • IAB, which provides a protocol for managing IETF, is therefore incorrect.
  • W3C is used in web development.
  • ISOC is used to provide Internet access.
7 0
3 years ago
my internet is really slow. i've tried rebooting my computer, erasing history, etc. how can i fix this problem?
Bingel [31]
Did u shut it down and then reset it????? Did you unplug your internet adapter????
3 0
3 years ago
Read 2 more answers
When Maggie attempted to reconcile her company's monthly sales revenue, she used a TOTALS query to sum the sales from the invoic
shusha [124]

Answer:

The correct answer is "Consistency".

Explanation:

  • It should have been continuous to have the information management service. All information must have been linked, gathered using the same technique as well as measurement but also displayed simultaneously frequencies.
  • Throughout this query, Maggie considers the organization proceeds by a system whereby financial transactions online are not influenced by trade payables or rebates as they are separate accounts that are afterward adjusted for the business model.

Thus, the above is the correct answer.

6 0
3 years ago
Other questions:
  • explain in detail how such a company can improve the focus and relationship with customers, and what they will benefit from this
    14·1 answer
  • A U.S. social security number consists of a string of 9 digits, such as "444422333". Declare a char array named ssn suitable for
    5·1 answer
  • Help me please and thanks
    8·1 answer
  • Play among us with me
    12·2 answers
  • What is the "online disinhibition effect"?​
    7·1 answer
  • A firm offers virtual local area networks and firewalls as an on-demand cloud service. Which service does the firm offer?
    11·2 answers
  • Why do you need to cite your sources? (check all that apply)
    15·1 answer
  • Which option is the primary means of communication for coauthors working on PowerPoint presentations?
    10·1 answer
  • Communication protocols, sets of rules agreed to by all parties, are designed in order to:
    15·1 answer
  • What are common considerations businesses need to make before purchasing new computers? Check all of the boxes that apply.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!