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
(40 pointsAnd brainliest answer ASAP) Maria is recording her friend’s graduation ceremony. How can Maria ensure that the video i
snow_lady [41]

Answer:

camera

Explanation:

3 0
4 years ago
I want to write a Java program to display the multiplication table for the number entered by the user and the values doesn’t exc
s344n2d4d5 [400]

Answer:

yes that is correct

Explanation:

hopefully this helps good luck

5 0
2 years ago
can anyone sub to my youttube channel pls, its called Yakobu, and Im trying to reach 100 subs by the end of the month :)
allsm [11]

Answer:

Sure

Explanation:

3 0
3 years ago
11. SQL Output III
borishaifa [10]

Answer:

wertweabcd

Explanation:

The LPAD() function left-pads a string with another string, to a certain length.

LPAD(string, length, lpad_string)

Parameter Description

string: Required. The original string. If the length of the original string is larger than the length parameter, this function removes the overfloating characters from string

length: Required. The length of the string after it has been left-padded

lpad_string: Required. The string to left-pad to string.

In example;

SELECT LPAD("SQL Brainly", 20, "ABC");

Output : ABCABCABSQL Brainly

4 0
2 years ago
Which of the actions below will not create more room on your hard drive?
slavikrds [6]
A. defragging your hard drive
4 0
3 years ago
Other questions:
  • In a transaction-processing system (tps), if the tps database can be queried and updated while the transaction is taking place,
    11·1 answer
  • Several steps are involved in creating a presentation. what is the last step in the process before preparing to presenting it?
    12·1 answer
  • When jump starting a vehicle , once the stalled vehicle is successfully started remove the cable in same order in which they wer
    13·1 answer
  • What computer device works like a central nervous system?
    11·1 answer
  • The ____ computing device had a memory capacity of 72 numbers and could be programmed to perform a 23-digit multiplication in ju
    6·1 answer
  • PLEASE HELP!!!!!!!!!!!!!!!!!!!!
    13·1 answer
  • Which type of digital picture is made by strong individual pixel value
    11·2 answers
  • Your company is planning to storage log data, crash dump files, and other diagnostic data for Azure VMs in Azure. The company ha
    12·1 answer
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • your own choice Identify an organisation of whether factual of fiction with the following Consideration:The three best os to int
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!