C Program to display the highest and lowest entered numbers. Programming Beginner -
I'm taking a C programming class in this semester and I do not have any programming experience, this made it very difficult for me. Has been done for assignment or study.
The assignment is to write a program that will allow the user to input any values and display the largest and lowest values inputed.
He will have to accept positive and negative numbers and entering 0 will end the program.
If the first number entered is 0, then a message stating that should be displayed.
It may be a lot of laughter for some of you, but I have it here.
#include & lt; Stdio.h & gt; Int main (zero) {float max = 0, a; Float min = 0, b; Printf ("entering 0 will end the sequence of input values. \ N"); Do {printf ("Enter Number:"); If (a & gt; min) {a = min;}}} (while one (=! =) 1); {If (a & lt; max) {a = max;} 0); Printf ("Your largest number was% .3f. Your smallest number was% .3f", max, minimum); Return 0; }
Also, any of you can recommend and reference material that will help me learn this material, thanks.
should be:
if (a & gt; max) {Max = a; } If (a & lt; min) {min = a; }
Comments
Post a Comment