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
zalisa [80]
3 years ago
7

Write and application that reads five integers from the user and determines and prints the largest and the smallest integers. Us

e only the programming techniques your learned in this chapter (use only if statements) 1.2. Modify your first program to add 2 more functions, the first function should determines the largest number and the second smallest. Both new functions must get invoked from the main function.
Computers and Technology
1 answer:
mixas84 [53]3 years ago
5 0

Answer:

#include <stdio.h>  

#include <limits.h>  

 

/* Define the number of times you are going  

  to ask the user for input. This allows you  

  to customize the program later and avoids the  

  hard coding of values in your code */  

#define NUMVALS 5  

 

int main(void)  

{  

   int i = 0;  

   int curval = 0;  

   /* Set your initial max as low as possible */  

   int maxval = INT_MIN;  

   /* Set your initial min as high as possible */  

   int minval = INT_MAX;  

 

   /* Loop through and ask the user for the defined  

      number of values */  

   for (i = 0; i < NUMVALS; i++)  

   {  

       /* Ask the user for the next value */  

       printf("Enter the next value: ");  

 

       /* Get the next value from the user */  

       scanf("%d", &curval);  

 

       /* Check to see if this is our biggest or  

          smallest value yet */  

       if (curval > maxval)maxval = curval;  

       if (curval < minval)minval = curval;  

   }  

 

   /* Output the results */  

   printf("The smallest value entered was: %d \n", minval);  

   printf("The largest value entered was: %d \n", maxval);  

 

   /* End the program */  

   return 0;  

}

Explanation:

You might be interested in
You have been on the phone with a user in a remote office for 30 minutes troubleshooting their minor desktop problem. No matter
Alecsey [184]

Answer:

D

Explanation:

First when you are troubleshooting a client your main goal is to solve their issue, you dont want to say hey call later i cant help you or say call someone else because picture this you need help and someone hangs up on you or says (B.) or (C.) it comes off as rude i would say. Regarding (A.) im not 100% sure what exactly do you mean by user's site? But asking for their manager (D.) or someone else (preferably higher up) seems to be the right action to be taken.

4 0
3 years ago
Plz help
vazorg [7]

The correct answer is:


a. All parts of the circuit will begin to carry higher amounts of current than normal.


Explanation:


When two or more than two conductors of different phases touch each other in a power line, the part of the impedance is shunted out of the circuit due to which a large current flow in the un-faulted phases, such current is called the short circuit current. Short circuit current decreases the impedance in the circuit while the current in the circuit increases.

8 0
3 years ago
Read 2 more answers
Can You do this to help me plz 50 points
MakcuM [25]
The doc is blank but thanks for the points!!
6 0
3 years ago
Read 2 more answers
Pls can anyone be so kind and answer this question.....i need the answer urgently
mixas84 [53]

Answer:

so u have to be smaet

Explanation:

8 0
3 years ago
Spanning Tree Protocol (STP) is a loop-prevention mechanism used in modern networks. STP is, however, vulnerable to misconfigura
maks197457 [2]

Answer:

Any of the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

Explanation:

Given that STP an acronym of Spanning Tree Protocol, and its major purpose is to stop the bridge loops and the broadcast radiation that emanates from its topology.

Cisco carried out three instruments or tools to protect the STP topology. These protection tools accompany the STP, and they are the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

3 0
3 years ago
Other questions:
  • Basically, if for every row, the absolute value of the entry along the main diagonal is larger than the sum of the absolute valu
    10·1 answer
  • What is an allocation unit?
    10·1 answer
  • If you could create a social network, what would it be like? What would make it so special about the others? (If you want you ca
    9·1 answer
  • How to wire two separate switches &amp; lights using the same power source?
    14·1 answer
  • What scientific principle would a plumber need to know when designing and installing plumbing a new construction
    13·1 answer
  • Write a function square_evens(values) that takes a list of integers called values, and that modifies the list so that all of its
    9·1 answer
  • Write a function named is_sub_dict that accepts two dictionaries from strings to strings as its parameters and returns True if e
    5·1 answer
  • _ is a term used for license like those issues by creative commons license as an alternative to copyright
    8·1 answer
  • Heres a survey
    7·2 answers
  • Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of th
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!