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 some limitations when it comes to testing and ensuring program quality? List at
DedPeter [7]

Answer:

the two limitation i can think about is the efficiency like if there are bugs or glitches or if it can get broken into and the second one is if it is running the correct program or not a lot of people deal with this problem.

Explanation: personally these are the two i can come up with at the moment

4 0
2 years ago
If you play gta and don't know the song ''Glamorous'' Then what do you even do when you play?
Paraphin [41]
You literally don’t do anything you’re just like dead of sun
4 0
2 years ago
Read 2 more answers
Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.
Pie

Answer:

Wah?

Explanation:

6 0
2 years ago
For the following 4-bit operation, assuming these register are ONLY 4-bits in size, which status flags are on after performing t
m_a_m_a [10]

Answer:

All flags are On ( c, z , N  )

Explanation:

Given data:

4-bit operation

Assuming 2's complement representation

<u>Determine status flags that are on after performing </u> 1010+0110

    1   1

    1  0   1  0

    0  1   1  0

  1  0 0 0 0

we will carry bit = 1 over

hence C = 1

given that: carry in = carry out there will be zero ( 0 ) overflow

hence V = 0

also Z = 1      

But the most significant bit is  N = 1

8 0
2 years ago
Select the correct answer.
Veronika [31]
I think it’s c. llS....
6 0
3 years ago
Read 2 more answers
Other questions:
  • This stores a piece of data and gives it a specific name
    7·1 answer
  • Was the big blue button thing a good decision or bad?<br> *I think it was a bad idea.
    15·2 answers
  • Which of the following is *not* true about logging user and program actions on a computer?
    10·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • Some data files should be totally hidden from view, while others should have ____ so users can view, but not change, the data.
    11·1 answer
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • Chuck plans to go on a hiking trip. Before the hiking trip, Chuck's bank account has $129.50. He then spends $129.50 on hiking g
    6·1 answer
  • A network systems administrator would most likely help with
    13·2 answers
  • Need answer ASAP!!!!
    14·1 answer
  • The code on the side is a software solution to the mutual exclusion problem for two processes. It shares two variables:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!