Write a C++ program that reads n integer values and stores them in an array of maximum 20 integers. Read from the user a valid value of n (n should not exceed 20). After reading the n array elements find and display the maximum and minimum elements.

Answers

Answer 1

Answer:

Following are the code to this question:

#include<iostream>//defining header file

using namespace std;

int main ()//defining main method

{

int x[20], n, i, maximum, minimum;//defining an integer array x and another integer variable  

cout <<"Enter the number of element you want to insert: ";//print message

cin >>n;//input size value from user end

if(n>20)//defining if block that check n is greater then 20

{

cout <<"The size of array should not exceed 20 element";//print message

return 0;//return 0

}

else//defining else block

{

cout<<"Enter array value: ";//print message

for(i=0;i<n;i++)//defining for loop

cin>>x[i];//defining for loop for input array value

maximum =x[0];//defining maximum variable that hold array value

for (i=0;i<n;i++)//defining for loop for check value

{

if(maximum<x[i])//defining if block to check maximum value

{

maximum=x[i];//hold maximum value

}

}

minimum=x[0];//use minimum variable to hold array value

for (i=0;i<n;i++)//defining for loop to hold minimum value

{

if (minimum>x[i])//defining if block to check minimum value

minimum =x[i];//hold minimum value

}

cout << "Maximum element : " << maximum ;//print maximum value  

cout << "Minimum element : " << minimum ;//print minimum value

return 0;

}

}

Output:

Enter the number of element you want to insert: 7

Enter array value:  

8

6

22

13

98

554

3

Maximum element : 554

Minimum element : 3

Explanation:

In the above-given program, an integer array "x", and four integer variable "n, i, maximum, and minimum" is defined, which uses the if block to check the size of the array.

In the else block, it inputs the array value from the user end and after input value, it uses the conditional statement to check the "maximum and minimum" value in its variable and print its value.


Related Questions

What are some options available in the Spelling and Grammar Checker? Check all that apply.

Redo
Undo
Ignore All
Ignore Once
AutoFormat
Add to Dictionary
Readability statistics

Answers

Add to Dictionary
kase ayun yung sa tingin kong tamang sagot soo yun na nga

Answer:

ignore all

ignore once

add to dictionary

Explanation:

took the assignment on edge2020

girls question
who wants to go out ;p

Answers

MEEEEE PICK ME CHOOSE ME IM LONELY

Answer: I do

Explanation: *P.S.* I'm a Boy

HELP ASAP!!!
Write a program that asks the p34won to enter their grade, and then prints GRADE is a fun grade. Your program should repeat these steps until the user inputs I graduated.

Sample Run
What grade are you in?: (I graduated) 1st
1st is a fun grade.
What grade are you in?: (I graduated) 3rd
3rd is a fun grade.
What grade are you in?: (I graduated) 12th
12th is a fun grade.
What grade are you in?: (I graduated) I graduated

It's in python

Answers

def func():

   while True:

       grade = input("What grade are you in?: (I graduated) ")

       if grade == "I graduated":

           return

       print("{} is a fun grade".format(grade))

func()

I hope this helps!

What piece of equipment changes the signal from the television camera into an electronic signal?
receiver
transducer
transponder

Answers

Answer:

Transponder

Explanation:

Transponder - a device for receiving a radio signal and automatically transmitting a different signal.

Answer:

transponder isnt correct i took the quiz its one of the other 2

Explanation:

the correct answer is transducer

how do i pay for the next year, i have a different credit card

Answers

Answer:

Pay for what next year

Explanation:

An increasing number of people who are tired of their finances being controlled by their credit card balances are picking up on a new practice – making multiple credit card payments per month. They are finding that by simply making two or more minimum payments to their credit card, their entire financial picture can change for the better. Here’s what you can expect if you take up the practice of making multiple credit card payments each month:

No More Late Payments

It may be stating the obvious, but if you diligently make multiple payments each month, you shouldn’t be late again which means fewer late fees. You will also avoid incurring any late payments on your credit report which will keep your credit score healthy.

Pay Down Your Debt Faster

Using the same principle for paying down your mortgage more quickly, the same can be accomplished with your credit card debt.

With a mortgage, you can split your monthly payment in two and pay it every two weeks. That results in 26 half payments, which is equivalent to 13 monthly payments. That one extra payment each year reduces the time it takes to pay off a 30-year mortgage by seven years. You can accomplish the same thing by dividing your monthly credit card payment in two and paying it every two weeks.

The faster you pay down your debt, the less you pay in monthly finance charges. How much could you save? Check out our Debt Payoff Calculator to find out!

Makes It Easier to Pay More Than the Minimum Payment

By making multiple credit card payments, it becomes easier to budget for larger payments. If you simply split your minimum payment in two and pay it twice a month, it won’t have a big impact on your balance. But if you make the minimum payment twice a month, you will pay down your debt much more quickly. Making multiple payments, especially if they are coordinated around your paychecks, can help you smooth out your cash flow and make it easier to increase your total monthly payment amount.

No More Interest Charges

When you do pay down your credit card debt you won’t have any more finance charges. Making multiple payments each month on your current balance ensures you won’t have a month-ending balance that will incur a finance charge.

Improve Your Credit Score

While making multiple payments each month won’t affect your credit score (it will only show up as one payment per month), you will be able to better manage your credit utilization ratio. Usually when you make a credit card payment on the due date, say on the 15th of the month, the credit card companies wait until the end of the month to report your activity. By then, you could have racked up additional credit card balances, which increase your credit utilization. That helps to improve your credit score.

Keeps You on Track With Your Budget

If you use your credit cards for monthly expenditures, such as food, gas, and other miscellaneous spending, then you can track your budget each time you make a credit card payment. Ideally, your credit card payments should not exceed your budget for the items purchased. If they do, it means you are overspending.

If you are paid twice a week, you can align your credit card payments with your paycheck, which will enable you to better control your monthly cash flow and stay on track with your budget.

Pay as You Go Keeps You in the Black

If you do use your credit card for non-budgeted purchases, paying multiple times can help ensure you pay off those purchases so you don’t carry a balance. If you do end up carrying a balance, you should increase your bi-weekly payments to pay it off more quickly.

It’s Easy to Make Multiple Credit Card Payments

It’s easy to make multiple payments to your credit card accounts. Although most card companies only allow you to set up one auto-pay per month, you are allowed to make a manual payment online anytime you want.

With some card companies, there is no limit to how many payments you can make in a month, but there may be a limit to the number of payments you can make in a 24-hour period. Alternatively, if your bank offers it, you can set up your second auto-pay through bill pay on your online bank account.

Explain in details how Galen , a physician during the Middle Ages, expanded on Hippocrates' theory of the four humors and explain what he believed each other humor represented ?

Answers

Answer:

Galen expanded on the Hippocrates' theory of humor by assigning personalities, moods, behaviors, and emotions to the four humors. He believed blood stood for sanguine personality, black bile for a melancholic personality, yellow bile for a choleric personality and phlegm for a phlegmatic personality.

Explanation:

Hippocrates put forward the theory of the four humors. According to the theory, the human body is made up of four substances: black bile, yellow bile, blood, and phlegm. A healthy human body is the product of a balance of among the four humors, while diseases results if there is an imbalance among the four humors.

Galen, a keen admirer of Hippocrates' ideas, further elaborated on this theory and believed that they affected personalities, moods, behaviors, and emotions.

The personalities assigned the four humors are as follows:

People with predominantly black bile are Melancholic (corresponding to the season of autumn dry and cold): They are very sensitive, and enjoy artistic pursuits.

People with predominantly yellow bile are Choleric (corresponding to the season of summer, dry and hot): They possess a passionate temperament, They have a lot of ambition, energy, drive, enormous vitality but are domineering and get angry quickly.

People with predominantly blood are Sanguine (corresponding to the season of spring, wet and hot): These people are confident, joyful, optimistic, expressive, confident, rational and sociable.

People with predominantly phlegm are Phlegmatic (corresponding to the season of winter, wet and cold): They are deep thinkers, fair, calm, very consistent, relaxed, and observant, willing to compromise, and hard workers.

Write a program that asks the p34won to enter their grade, and then prints GRADE is a fun grade. Your program should repeat these steps until the user inputs I graduated

Answers

Answer:

Following are the code to this question:

def fun():#defining a method fun

  while True:#defining a while loop  

      g = input("Enter your grade: (I graduated) ")#defining variable g for input value

      if g == "I graduated":#defining if block to check string value

          return 0#return  

      print("{} is a fun grade".format(g))#use print method to print string value  

fun()#calling the method

Output:

Enter your grade: (I graduated) 1st

1st is a fun grade

Enter your grade: (I graduated) 2nd

2nd is a fun grade

Enter your grade: (I graduated) I graduated

Explanation:

In the given python code, a method "fun" is defined, and inside the method, a while loop is defined, which uses a variable "g" for input value from the user-end.

In the next step, if block is defined to check string a value and return a value 0, and use the print method to print the given value, and call the above method fun.  

Which function will find the difference of 15 and 3 and return 12 when the main part of your program has the following line of code?

answer = subtract(15,3)

def Subtract(numA, numB):
return numA - numB

def Subtract(numA, numB):
return numB - numA

def subtract(numA, numB):
return numA - numB

def subtract(numA, numB):
return numB - numA

Answers

Answer:def subtract(numA, numB):

   return numA - numB

Explanation:

i got the right answer but i was willing to get it wrong for the right anwser for you

The function that will find an accurate difference of 15 and 3 and return 12 when the main part of your program has the following line of code is as follows:

def subtract(numA, numB):

       return numA - numB

Thus, the correct option for this question is C.

What is the significance of the output of the program?

The significance of the output of the program is understood by the fact that it delivers some values or concepts to the user with respect to the instruction he/she is given to the computer for processing. The output of the program is very specific in nature.

According to the question, you have to assume the value of number A as 15 and number B as 3. So, when you find the difference between these numbers, you get an output of 12.

You must follow the process as follows while framing a program:

def subtract(numA, numB):

         return numA - numB

Therefore, the correct option for this question is C.

To learn more about Output of a program, refer to the link:

https://brainly.com/question/18079696

#SPJ2

Which item cannot be inserted into a header or footer of a document?

Answers

Answer:

All the above items can be inserted into either a header or a footer.

Please mark brainliest!

The items that cannot be inserted into a header or footer of a document is all the above items can be inserted into either a header or a footer. The correct option is d.

What is a header or footer?

A document is a type of information that can be stored electronically. Page numbers are generated automatically. Tables with columns and rows, pictures, shapes, and clipart can all be inserted into a document's header or footer. As a result, all of the items listed above can be inserted into the header or footer.

A header is text at the top of a page, whereas a footer is text at the bottom, or foot, of a page. Typically, these spaces are used to input document information such as the document's name, chapter heading, page numbers, creation date, and so on.

Therefore, the correct option is d, All the above items can be inserted into either a header or a footer.

To learn more about the header or footer, refer to the link:

https://brainly.com/question/4637255

#SPJ2

The question is incomplete. Your most probably complete question is given below:

Automatic page numbers

Tables with columns and rows

Pictures, shapes, and clipart.

All the above items can be inserted into either a header or a footer.

what is meant by byte in computer terminology​

Answers

Answer:

Byte, the basic unit of information in computer storage and processing. A byte consists of 8 adjacent binary digits (bits), each of which consists of a 0 or 1. The string of bits making up a byte is processed as a unit by a computer; bytes are the smallest operable units of storage in computer technology.

Explanation:

Can I be brainliest? TYSMMMMMM      

A byte is a group of binary digits or bits (usually eight) operated on as a unit. It is considered as a unit of memory size.

A peripheral can be used to tell a computer to complete a specific task.
A) True
B)False

Answers

Answer:

A. true

Explanation:

because you can complete it without it mistakes if your using an computer but if you use an paper you will make mistakes over and over

The background color indicates the background image of the web page.

True or false?

Answers

This is false. The background color refers to a solid color while the background image just an image.

The background color indicates the background image of the web page is false.

What is distinction among history and history photo?

In a history asset, you could upload history-color, repeat , no-repeat and different photo attributes, however withinside the history-photo assets you're most effectively allowed to feature photos. Show hobby in this post. By the usage of history, you want to specify a different arguments to set the history of the page.

The Background Color facts is saved for photo and image documents that have a color distinctive to the photo history. The history colour is, in maximum cases, displayed withinside the shape of an RGB triplet or a hexadecimal code.

Read more about the web page:

https://brainly.com/question/3700565

#SPJ2

The way a student prepares for a test or reviews academic material is referred to as

a study environment.
study habits.
study hall.
a study schedule.The way a student prepares for a test or reviews academic material is referred to as

Answers

Answer:

study habits

Explanation:

Answer:

The Answer is Study Habits

Explanation:

Just got it right on edge

what is a cloud in the world of computing

Answers

Answer:

In the simplest terms, cloud computing means storing and accessing data and programs over the internet instead of your computer's hard drive

Explanation:

Before he buys a new smartphone, Tim can best use data to

evaluate which phone he should get.
convince himself he wants a phone.
discredit others’ opinions on his phone choice.
recognize problems that all phones have.

Answers

It’s A or the first one, kinda like process of elimination, the second and third one are obviously eliminated first so then it’s just between a and d. But a makes more sense as to he has to buy one either way

Answer:

A.) Evaluate which phone he should get

Explanation:

Edge2020

Please Help!

Choose all items that are characteristics of placing nested elements on a new line, using indentation.


A) makes HTML errors difficult to find

B) not required by a web browser

C) can cause web page display errors

D) makes HTML analysis and repair easier

E) done automatically by HTML authoring software

Answers

Answer:

Its B,D,E

Explanation:

Got it right on e2020

Answer:

B). not required by a web browser

D). makes HTML analysis and repair easier

E). done automatically by HTML authoring software

Btw cause this class can be a pain here are the answers to the rest of the assignment.

Slide 7/12:

The missing element is

C). <p></p>

Slide 9/12:

The missing tag is:

B). an end (closing) a tag

Slide 12/12:

The missing character is

D). an angle bracket

Explanation:

I just did the Part 3 on EDGE2022 and it's 200% correct!

Also, heart and rate if you found this answer helpful!! :) (P.S It makes me feel good to know I helped someone today!!)

Which is the fastest way to make many formatting changes to a range of cells?
select each cell, right-click, use the ribbon to make changes
select the range, right-click, use the ribbon to make changes
select the range, right-click, format cells, make changes
select each cell, right-click, format cells, make changes

Answers

Answer:

c 3

Explanation:

c 3

Answer:

I believe it could be C

Explanation:

Please click "Thanks" if this helped in any way! :)

Question # 6
Math Formula
What is the output of this program? Assume the user enters 2, 5, 1, and 6.

numA = 0
for count in range(4):
answer = input ("Enter a number: ")
fltAnswer = float(answer)
numA = numA + fltAnswer
print (numA)

Answers

Answer:

14.0

Explanation:

The loop converts each answer to a float. The accumulator variable adds the values entered.  

2.0 + 5.0 + 1.0 + 6.0 = 14.0

Answer:

14.0

Explanation:

Edge 2021

Taylor is getting ready to send an e-mail. In three to five sentences, give Taylor some advice for sending an effective email.

Answers

Answer:

Include subject lines since they are importantuse bullet pointskeep it shortavoid too many exclamation markswatch your tone

I have a aline gaming laptop and it has ransome ware on it that wants 2000$ can i get it back????

Answers

Answer:

Umm

Explain

yea i think you can  

Answer:

take out the Hard Drive or SSD and take it to a data recovery place. It should be much cheaper there. Maybe $100 or so.

Explanation:

What does a coder do on a daily basis?

Answers

medical charts and assinging codes

most 4 year colleges want an applicant's scores for all the following except

Answers

Answer:

IQ

Explanation:

How did New York Governor Hugh Carey handle Sostre’s situation?

Answers

Answer:

The governor found a way to free Sostre without assessing whether or not he was guilty or innocent of drug crime in buffalo.

Explanation:

Answer:

The governor found a way to free Sostre without assessing whether or not he was guilty or innocent of drug crime in buffalo.

Explanation:

correct on e2020 Dawg

MULTIPLE COICE! BRAINLIEST
When using design templates, these elements will be determined for you.
bullets
background
color scheme
content
title
font

Answers

Answer:

background

Explanation:

Plzzzzz help me with this and be serious dont comment random things
Write an algorithm using pseudocode that someone else can follow. Choose one of the following options:

Decide on the message you would like to display to the screen. Some ideas include:
Your favorite book title or TV show and why you like it
A few sentences sharing information about you
Your favorite sport and team or athlete
Use two variables to store your message.
Insert your pseudocode here:











Part 2: Code the Program
Use the following guidelines to code your program.

Use the Python IDLE to write your program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Set up your def main(): statement. (Don’t forget the parentheses and colon.)
Use at least two variables and two print statements to display your message to the screen.
Conclude the program with the main() statement.
Follow the Python style conventions regarding indentation in your program.
Run your program to ensure it is working properly. Fix any errors you may observe.
Example of expected output: The output below is an example of a “Favorite TV Show” message. Your specific results will vary depending on the choices you make about your message.

Output

My favorite TV show is MythBusters.
I like it because I learn a lot and they do crazy experiments.


When you've completed writing your program code, save your work by selecting 'Save' in the Python IDLE. When you submit your assignment, you will attach this Python file separately.

Part 3: Post Mortem Review (PMR)
Write two to three sentence responses to all the questions in the PMR chart.

Review Question Response
What was the purpose of your program?
How could your program be useful in the real world?
What is a problem you ran into, and how did you fix it?
Describe one thing you would do differently the next time you write a program.

Answers

Answer:

legal and ethical questions

brick and mortar guidelines

website content

customer information

the facts of life

payment processing

human resources

this is in career explorations 2 please help will mark the brainiest ​

Explanation: yes he is right this is correct

Select the correct answer.
What is a hyperlink?
A.
A bold link that goes back to a newspaper
B.
A link that clicks on itself
C.
A way to cite sources in an online article
D.
A special link on a smartphone

Answers

Answer:

c.

Explanation:

a link from a hypertext file or document to another location or file, typically activated by clicking on a highlighted word or image on the screen.

Answer:

c

Explanation:

came out my study guide and i made a 96 % on my 50 question test

Which best describes what happens when a formula is copied from one cell to another?
The cell references in the formula remain the same to match the cell that the formula is pasted into.
The cell references in the formula remain the same as they were in the original cell.
The cell references in the formula change to match the cell that the formula was copied from.
O The cell references in the formula change to match the cell that the formula is pasted into.
Hurry up

Answers

Answer:

b 2

Explanation:

b2

Which search phrase is the most effective to find out about the most popular pizza chains worldwide in 2019?
A.
popular pizza chains in the world
B.
most popular AND pizza chains AND worldwide AND 2019
C.
the most popular pizzas “in the world today” AND 2019 AND chains
D.
2019 worldwide pizza chains “most popular in the world”

Answers

D I believe is correct

Answer:

D

Explanation:

any song recommendations, pls dont say 6ix9ine or lil pump

Answers

I actually do have one tho. Try Megan Tha Stallion.

Answer:

smash mouth "all star" is my fave or Imagine Dragons "Whatever it Takes"

Explanation:

when a company sends you recommendations of what to buy you know that :

Answers

Answer:

Clothes

Explanation:

Other Questions
5. The length of a rectangle is 3 inches less than its width. If theperimeter is 74 inches, find the dimensions of the rectangle. passenger plane is flying above the ground. Describe the two components of its mechanical energy. How people are affected by their environment its riddle timeYou live in a one story house made entirely of redwood. What color would the stairs be? Identify the cultural traits that belong to Brazil, Italy, or both.There is:Pasta passion for soccer samba dancePortugueseroman catholicism plz help me Rachel is five years younger than Monica. If the sum of their ages is 21, find the age of each girl.plz, answer this is due today !!! What is the domain of the relation graphed below? There are 6 points on a coordinate plane. The points are (negative 5, 0), (negative 4, 1), (negative 3, 4), (1, negative 2), (2, 4), (5, negative 3). Oil is removed from the refrigerator vapor by a: Which of the following is a shared value in American culture?O CensorshipO DemocracyO DiscriminationO InjusticeASAP Consider the line 4x+2y=-7.What is the slope of a line perpendicular to this line?What is the slope of a line parallel to this line? Integers that satisfy the inequality -9 < x -3 < 1? look at the picture lol From the information presented in paragraph 1, what can the reader conclude about the importance of Texas energy production in the United States? Nousde la tte. (1 point)O souffrezO souffrentO souffronssouffre7 chance the corrert form of the warh What did the Arabs copy from the Persians? Question 2 of 25Rain exists in which phase?O A LiquidO B. SolidC. PlasmaD. Gas What is the correct definition of the given vocabulary word?adversaryA substance that makes things stickThe action of a body or thing striking against anotherAn enemyThe capacity to keep afloat How did the Industrial Revolution affect socioeconomic stratification? The AREA of a rectangle is the product of length and width.Write a simplified expression for the AREA of the rectangle below.X Can someone help me with this math problem