in C program
For this assignment, you will need to build a program that does the following:
The process of finding the largest value is used frequently in computer applications. For example, a program that determines the winner of a sales competition would input the number of units sold by each salesperson. The salesperson who sells the most units wins the contest. Write a program that has the user input a series of 10 integers and determine and print the largest integer. Your program should use at least the following three variables:
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).
number: The integer most recently input by the user.
largest: The largest number found so far.
You must use a while loop as well as an if statement.
Properly give the user instructions, take input and print the largest number before saying goodbye to the user.
The program output will look something like this:
Please enter 10 integers and I will find the largest for you.
12
200
52
63
85
99
41
400
10
0
The largest number is: 400
Have a great day.
Step by stepSolved in 3 steps with 1 images
- LOTTERY Bill buys 10 lottery tickets which he plays randomly. Let us write a C# program for Bill that suggests random numbers for him. After the winning numbers are drawn, the program informs Bill of the results of each lottery ticket. There are 5 winning numbers in one lottery ticket. Each number is from 1 to 90.arrow_forwardIn C++ write a program that generates three random numbers and then find the min number among the generated values, using these three functions: void getrandnum(int &n1, int &n2, int &n3), int findMin(int n1, int n2, int n3), and void printResult(int n1, int n2, int n3, int min). Make the main function drive all these functions.arrow_forwardC Programming Write a program that reads an integer from the user (keyboard), namely n. Yourprogram should print all positive numbers that are smaller than n and whosedigits sum up to a perfect square number.(An integer is a perfect square if it hasan integer square-root for example 25) You should print the numbers in ascendingorder and print their digits separated by “:“ symbol from the least significant digitto the most significant digit on the same line as the number. At the end of eachline you should also print the sum of the digits of the number. Example:If the user enters n : 30, then the output should be as follows:1 1 14 4 49 9 910 0:1 113 3:1 418 8:1 922 2:2 427 7:2 9arrow_forward
- In C++: Print a table that prompts the user to enter the current tuition and displays a table that displayshow many years the tuition will be doubled if the tuition is increased by 5%, 6%, and up to 10%annually. Here is a sample run: Enter the current year tuition: 20000 Rate Number of Years 5.0% 15 6.0% 12 7.0% 11 8.0% 10 9.0% 9 10.0% 8 1. Add comments throughout the program explaining your code.2. Use meaningful names for variable names.3. Submit program in .cpp filearrow_forwardC++ with multiple functions if possible Write a program to simulate an automated teller machine (ATM) at a bank. The program should ask the user for a four-digit personal identification number (PIN) to verify they are supposed to have access to the account. If they enter the PIN incorrectly, they should be denied access to the account, but the program should automatically ask them to enter the PIN again. It is up to you to decide if you want to give a maximum number of tries before exiting. The ATM program should ask the user for a beginning balance, and then provide the user with the opportunity to enter deposits and withdrawals until the user wishes to exit the program. Upon exiting the program, it needs to display the current balance.arrow_forwardin C++arrow_forward
- please solve as soon as possiblearrow_forwardSolve it as soon as possible using C programarrow_forwardScenario: I am trying to create a recursion function that takes a number from the user. That number then goes through to equations where it squares the number and takes the square root of it. Then, that value is supposed to be sent back through the function, through the same equations. Then, I am trying to output the value of each iteration. The amount of iterations is a random number. This code is in C++ and I am using Visual Studio 2023. I have attached the code I, myself, typed and picture of the output. Also, this is a header file that is being called from my source.cpp file (case 5 in switch case). That is why I am entering 5 as the first input when I run the program. Problem: The output only shows one iteration of calculation, then goes straight back into taking an input from the user. What am I doing wrong?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education