I'm taking a C programming class this semester and I have absolutely no programming experience, this is making it extremely difficult for me to do the assignments or even study.
the assignment is to write a program that will allow the user to input any amount of values and display the largest and smallest values that were inputted.
it has to accept positive and negative number and entering 0 will terminate the program.
if the first number entered is 0 then a message stating this must be displayed.
this may be quite laughable to some of you, but here is what I have.
#include <stdio.h>
int main(void)
{
float max=0, a;
float min=0, b;
printf("Entering 0 will terminate the sequence of input values.\n");
do{ printf("Enter Number:");
if (scanf(" %f", &a)==1);{
if(a<max){
a=max;}
if(a>min){
a=min;}
}
} while(a!=0);
printf("Your largest number was %.3f. Your smallest number was %.3f.", max, min);
return 0;
}
also, can any of you recommend and reference materials that will help me learn this stuff, thank you.