Newbie trying to create a program in C language has run into an error can you help?
Code:
#include <stdio.h>
#include <conio.h>
int main(void){
int stw;
int weight;
int total;
stw=190;
total=0;
loopcount=0;
while (loopcount<3){
printf("Hello Mickey, what is your weight today?");
scanf("%d", &weight);
loopcount=loopcount+1;
}
total = stw - weight;
printf("Total weight lost is %d", weight);
scanf("%d", &total);
getch();
getch();
}
I get the error:
`loopcount' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
Please help with this simple program if you can. Thank you.