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
Irina-Kira [14]
3 years ago
6

Write a C program that uses a while statement to determine and print the largest of 10 numbers input by the user. Your program s

hould use three variables, as follows: a) counter--A counter to count to 10 (i.e., to keep track of how many numbers have been input and to determine when all 10 numbers have been processed). by) number--The current number input to the program. c) largest--The largest number found so far.
Computers and Technology
1 answer:
Kamila [148]3 years ago
5 0

Answer:

The program in C is as follows:

#include <limits.h>

#include <stdio.h>

int main(){

   int count = 0;

   int number, largest = INT_MIN;

   while(count<10){

       scanf("%d",&number);

       if(number>largest){

           largest = number;        }

       count++;    }

   printf("Largest: %d",largest);

   return 0;

}

Explanation:

This initializes count to 0

   int count = 0;

This declares number and largest; largest is also initialized to the smallest integer

   int number, largest = INT_MIN;

This loop is repeated while count is less than 10

   while(count<10){

Get each number

       scanf("%d",&number);

If current input is greater than the largest integer, largest is updated to the current input

<em>        if(number>largest){</em>

<em>            largest = number;        }</em>

Increase count by 1

       count++;    }

Print the largest

   printf("Largest: %d",largest);

You might be interested in
Which shot is not the best for a widescreen image
sasho [114]
Closeup? I think I’m pretty sure but I don’t really know though
7 0
3 years ago
Read 2 more answers
Which of the following is non-volatile storage?
gulaghasi [49]
Primary because it is non-volatile storage
6 0
3 years ago
In Python, while loops will repeat during the time the test condition is true.
frez [133]

Answer:

It is true

Explanation:

3 0
2 years ago
Read 2 more answers
Which types of networks cover large geographical areas such as several states? PAN
aleksley [76]

MAN

Explanation:

Metropolitan Area Network

Local Area Network

Wide area Network

7 0
3 years ago
Part of the central processing unit
AveGali [126]

Answer:

Explanation:

The arithmetic logic unit (ALU) performs mathematical, logical, and decision operations.  It can be divided into the arithmetic unit (responsible for addition, subtraction, multiplication and division).  And logic unit (responsible for comparing, selecting, matching and merging different data or information).  The power and efficiency of the CPU depends on the design of the ALU.  

Next up is the control unit (CU) which directs all the processor’s operations.  It’s where the CPU reads and interprets requests from memory and transforms them into a series of signals (binary).  Then it sends the operation to various parts of the laptop as instructed.  The CU calls the ALU to perform the necessary calculations.  It also coordinates all input/output devices to transfer or receive instructions.

The main job of the memory unit is to store data or instructions and intermediate results.  It’s divided into primary memory and secondary memory to supply data to other units of the CPU.  It allows the CPU to perform functions requested by programs like the operating system without having to ask RAM.

Another element of the CPU not depicted in the diagram is transistors.  To carry out calculations, binary information (ones and zeros) is stored in these microscopic switches.  They control the flow of electricity depending on whether the switch is ON or OFF.  Signals turn off and on different combinations of transistors to perform calculations.  A very thin silicon chip can contain several hundred million transistors.

8 0
3 years ago
Other questions:
  • Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
    15·1 answer
  • Which of the following provides astronomical evidence for the age of the earth?
    11·1 answer
  • Discuss anomaly detection.
    5·1 answer
  • Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he'd like to learn if
    9·2 answers
  • The symbol located to the left of a code number that identifies a code description that has been revised is _____.
    12·1 answer
  • During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender
    6·1 answer
  • Name 3 things that you use daily that are considered computers?
    6·1 answer
  • A screen capture is a digital image of your screen, as if you took a picture of it with a camera. For instance, you might want t
    15·1 answer
  • Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know th
    10·1 answer
  • write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!