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
If you attempt an edgeunity quiz is your latest attempt the one counted?
tekilochka [14]

Answer:

Hello

Explanation:

Hello profile picture of a nub how are you doing today?

8 0
3 years ago
Several of the items below indicate the steps required to move a slide to a different location in a presentation. Select those s
NikAS [45]
The answer should be
2
4
3
5
1
6
8 0
3 years ago
Read 2 more answers
You use the ____ operator to reverse the meaning of a boolean expression.
charle [14.2K]
!  actually it means not, which reverses a boolean.
8 0
3 years ago
A window frame will expand to fill the entire desktop when you
natima [27]
A. Sometimes it is marked by outwards pointing arrows (<= =>) with the reverse (collapsing so as to not take up the whole screen) being in the same spot, marked by inwards arrows (=> <=)
8 0
3 years ago
Give two examples of a large databases that might be used to help members of the public
frutty [35]

Answer:

Examples of large database that might be used to help members of the public are;

1) Apple Healthkit, Carekit and Researchkit

2) IBM Deep Thunder

Explanation:

1) The use of medical aid wearable devices that give instant data feed into the the a patients electronically stored health record has become possible and include the listed Apple technologies that enable the iPhone get instant access and feed back on individual health records

2) Large databases are used for weather forecasting by the processing of big data with the aid of very powerful computers by IBM Deep Thunder, which can also forecast natural disasters and the likelihood of wreckage in utility lines.

8 0
3 years ago
Other questions:
  • Navigational signs on the highway are often which colors?
    10·2 answers
  • Which is the best description of a computer virus?
    5·2 answers
  • Which command should you enter to configure a single port to discard inferior bpdus 200-125?
    5·1 answer
  • Anyone wanna play roblox?? My user is Tsvetok_luis
    11·2 answers
  • What is the name of the amount of space between the content of a document and the edge of the page
    13·1 answer
  • Guys Do you know about e-waste recycling well ?
    9·2 answers
  • This site isn't letting me add my ans and wut should I do?
    15·1 answer
  • A(an)_______is built-in preset calculation. <br>formula <br> function <br>equation <br>AutoSum​
    12·1 answer
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • Question 2 of 10
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!