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
Anna007 [38]
3 years ago
8

Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program will determine (a) the largest i

nteger entered, (b) the smallest integer entered, and (c) the average of the integers entered, and print these values to the screen.
1) Your program will begin by notifying the user to input an integer sequence from the keyboard, one-at-a-time, and to hit the Enter key after typing each integer. Notify the user to hit Ctrl-z (EOF) when they are done entering integers.
2) Your program should declare an integer variable to hold the largest entered integer, an integer variable to hold the smallest integer entered, a float variable to hold the sum of the entered integers and an integer variable to count how many integers are entered by the user. Initial iret to +1 and initialize the other three variables to zero.
3) Your program should use a while loop to continue reading integers from the keyboard until the user is done.
4) The user is done when they enter Ctrl-z from the keyboard. How can your program determine when the user has entered Ctrl-z? Consider the following program segment. int ienter=0,iret=0; iret=scanf("%d",ienter); When the user enters an integer from the keyboard, scanf(will return +1 (success), indicating that it correctly read-in an integer. The integer entered by the user is stored in variable ienter and the return value from scanf() is captured and stored in variable iret.
When the user enters Ctrl-z (EOF), scanf(will return-1 (EOF) indicating an integer from the keyboard was not correctly read-in. That is, if the user enters Ctrl-z (EOF), no value is stored in variable ienter and the - 1 returned by scanf() is captured and stored in variable iret. So to test when the user is done entering integers, the while loop should continue looping (reading integers from the keyboard) as long as iret is equal to +1.
ienter=0;
iret=scanf("%d",&ienter);
ilargest=ienter;
whileiret == 1){
ireto=scanf("%d",&ienter); // read another integer from the keyboard
5) When the user enters the very 1 integer, your program will initialize the variables for the largest and smallest integers and the variable for the sum to this 1 integer entered by the user. Why? If no more integers are entered by the user, these variables will hold the correct values. The variable for the number of integers entered by the user should be incremented by 1 whenever an integer is entered by the user.
6) After the user has entered Ctrl-z, meaning the user is done, the variable for the average should be computed as the sum of the entered integers divided by the number of integers entered by the user.
7) Your program will display the largest and smallest entered integers, the number of integers entered by the user, and the average of the integers.
Get more help from Chegg
Computers and Technology
1 answer:
Natali [406]3 years ago
3 0
It’s not letting me answer it
You might be interested in
I will mark you as BRAINLIEST if you give me the correct answer of the questions... Pls asap with all details i am time limited
Alex_Xolod [135]

Answer:

11. 1million square decimetres (from online)

20. assuming room is rectangular,

length= (p - 2b)/2

because perimeter= 2 length + 2 breadth for rectangular

6 0
3 years ago
Read 2 more answers
David bought 5.2 pounds of oranges for $1.20 per pound . how much did david spend ..............................................
Tcecarenko [31]

Answer:

David spent $6.24.

Explanation:

5.2 times 1.2

3 0
3 years ago
8.6 Lesson Practice edhesive
scoundrel [369]

Incomplete question. I could only infer you are possibly referring to edhesive unit 8 questions. Here are a few sample questions;

1. Where does Python start?

2. To create the body of a function, we ____________ the code.

Answer:

1. Main Section

2. Indent

Explanation:

1. It is a common rule in Python programming language when coding for for it to begin at the first part of the Main Section.

2. Indenting a code involves creating space or jumping a line away from the margin of the text dialogue box, thus the code written there becomes the body of the function.

8 0
3 years ago
Ethernet and wireless networks have some similarities and some differences. One property of Ethernet is that only one frame at a
Arada [10]

802.11 do not share this property with Ethernet this is because Wireless networks is known to have a kind of potential parallelism, and as thus, it differ from Ethernet.

<h3>What is a Wireless networks?</h3>

Wireless networks are known to be a kind of computer networks that are said to not need to be connected by form of cables.

The use of a wireless network is one that helps firms to avoid the costly prices of using cables in their buildings or as a form of connection between their various equipment locations.

Learn more about Ethernet from

brainly.com/question/1637942

4 0
2 years ago
Under which reflection(s) is the image of line m also a line?
lubasha [3.4K]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Sorry to bother you guys but for some reason it wont let me comment. How can i fix this?
    5·2 answers
  • How does a spreadsheet affect a column of numerals when it sorts the column
    15·2 answers
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • Lisa managed incident response for a bank. The bank has a website that’s been attacked. The attacker utilized the login screen,
    9·1 answer
  • If your vehicle leaves the pavement for any reason, remember to take your foot off the gas pedal, hold the wheel firmly, and____
    8·2 answers
  • The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for t
    7·1 answer
  • What is one of the main problems with shared web hosting? Select one: Sites that share resources are less susceptible to hacking
    8·1 answer
  • What is the second step when designing an algorithm?
    12·2 answers
  • 5. Write the name of the tab, command group, and icon you need to use to access the
    11·2 answers
  • Can you make a phone app with angular?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!