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
What are two preferences a user can indicate for the Junk Email folder?
marysya [2.9K]
Did you mean this?
<span>Controls are divided between two locations: (a) </span>Tools -> Options<span> -> Security -> Junk, and (b) Tools -> Account Settings -> *each account* -> Junk Settings.</span>
5 0
3 years ago
Read 2 more answers
structured analysis is called a(n) _____ technique because it focuses on processes that transform data into useful information.
zzz [600]

Answer:

Process - centered technique

Explanation:

Process - centered technique -

It is the method , where the useless or waste data is converted to some useful information , is referred to as process - centered technique .

This conversion process requires some activities , like  maintenance/support  , implementation , design , analysis and  planning .

Hence , from the given information of the question,

The correct option is Process - centered technique .

4 0
3 years ago
Need help asap<br> give the correct answer!!
blagie [28]
It’s either b or c, but my final answer would be C
4 0
2 years ago
Read 2 more answers
The general syntax for the function prototype to overload the assignment operator = for a class is ____.a. friend className&amp;
dsp73

Answer:

Option (B) is the correct answer to the following question.

Explanation:

Here, in the code "const" is the constant keyword which is used when we need that the value stored in that variable will never change.

The following option is correct because the assignment operator are those operator which initialize the value in the variable and overloading of the assignment operator would be as we use the other operators and also we could use them by creating the objects as we use in the copy constructor.

So, that's why the following option is correct.

4 0
3 years ago
Who says spirits of northern vale guide Me in Mobile legends
Yuliya22 [10]
What? i’m so confused lol, do you have a question?
4 0
2 years ago
Read 2 more answers
Other questions:
  • Storing a value in a variable<br> Exponent<br> Variable<br> Assignment<br> Operator
    13·1 answer
  • With a _____ network connection, the computers and other devices on the network are physically connected via cabling to the netw
    13·1 answer
  • Put the steps of the decision-making process in the correct order.
    12·1 answer
  • What is output? <br> Print (12 % 5)<br><br> Answer <br> 0<br> 5<br> 2<br> 1
    12·2 answers
  • When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
    15·1 answer
  • Which of the following is not an element of the modified block style?
    7·2 answers
  • A small company with 100 computers has hired you to install a local area network. All of the users perform functions like email,
    9·1 answer
  • - A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well
    6·1 answer
  • What is string literal in Java?
    5·1 answer
  • which type of processor chip is designed to perform a single function and is typically custom-designed?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!