Question

I need to write a program in C that covers this: I need in c language...

I need to write a program in C that covers this:

I need in c language

Design a program with a loop that lets the user enter a series of numbers the user should enter -99 to signal the end of the series. after all the numbers have been entered, the program should display the largest and smallest numbers entered.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Code:

#include <stdio.h>
int main()//main function from where execution begin
{
   int num, max=0, min=99999; //variable declaration
   while(1) //infinite loop
   {
       printf("\nEnter Number(-99 to stop): ");
       scanf("%d", &num);//reasd number enter by user
       if(num == -99) //if input is -99 break the loop
           break;
       if(num < min)// if enter number is min than previous min
           min =num;
       if(num > max)// if enter number is max than previous max
           max = num;
   }
   //Display Result
   printf("\n Largest number in series: %d", max);
   printf("\n Smallest number in series: %d", min);  
   return 0;
}

Screen:

#include <stdio.h> int main() //main function from where execution begin F { int num, max=0, min=99999; //variable declaratio

Add a comment
Know the answer?
Add Answer to:
I need to write a program in C that covers this: I need in c language...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2) Largest and Smallest Design a program with a loop that lets the user enter a...

    2) Largest and Smallest Design a program with a loop that lets the user enter a series of numbers. The user should enter-99-99 to signal the end of the series. After all the numbers have been entered, the program should display the largest and smallest numbers entered. a) Use a Do-Until Loop

  • Write a program that lets the user enter 10 values into an array. The program should...

    Write a program that lets the user enter 10 values into an array. The program should then display the largest and the smallest values stored in the array. The program should display the following message to the user at the beginning "This program will ask you to enter ten values. Then it will determine the largest and smallest of the values you entered.Please enter 10 integers separated by spaces: " And then after user entered the numbers, it should display...

  • In C++ 2. Write a program that allows the user to enter a series of positive...

    In C++ 2. Write a program that allows the user to enter a series of positive numbers between 1 and 100 and displays the smallest and largest of the numbers entered. The program should not store the numbers that were entered, only keep track of the smallest and largest ones. The program should continue accepting numbers until the value 0 is entered and then display the results. If a number out of range is entered, tell the user it is...

  • please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute....

    please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute. Design a pro- gram that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. 3 part two) Sum of Numbers Design a program with a loop that asks the user to enter a series of positive num bers. The user should enter a negative number to signal the end of the series. After all the...

  • 3. (c-program) Write a program that finds the largest and smallest value in a series of...

    3. (c-program) Write a program that finds the largest and smallest value in a series of numbers entered by a user. The user must enter 25 values. Note if that if the user enters "0" they must correct and add another number. Print out the original entered values, the largest number, the smallest number. Note whether the user tried to enter "O".

  • need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that...

    need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that first prompts the user for an upper limit: Enter the number of entries: 5 € (user enters 5) After the user enters a number, the program should prompt the user to enter that many numbers. For example, if the user enters 5, then the program will ask the user to enter 5 values. Use a do-while loop to add the numbers. o With each...

  • In C++ Write a program that lets the user enter at least 10 values into an...

    In C++ Write a program that lets the user enter at least 10 values into an array. The program then display the largest and smallest values stored in the array.

  • Write a program that lets the user enter at least 10 values into an array. The...

    Write a program that lets the user enter at least 10 values into an array. The program should then display the largest and smallest values stored in the array. Do it in C++

  • In Python 3, Write a program that reads a set of floating-point values. Ask the user...

    In Python 3, Write a program that reads a set of floating-point values. Ask the user to enter the values, then print: The number of values entered. The smallest of the values The largest of the values. The average of the values. The range, that is the difference between the smallest and largest values. If no values were entered, the program should display “No values were entered” The program execution should look like (note: the bold values are sample user...

  • in c++ language 1.Re-write the following for loop statement by using a while loop statement: int...

    in c++ language 1.Re-write the following for loop statement by using a while loop statement: int sum = 0; for(int i=0;i<=1000;i++){                 sum+=i; } 1 (b). Following is the main () function of a program. The program asks a user to enter 150 integers and print the largest integer user entered. int main() {    int score, highest;             //missing portion of the program             return 0;    } 1(c). Find the missing portion of the following code, so the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT