Usually I send a message to DreamInCode.net, but the site seems to be down now. I am the first CS student at De Anza. I really don't understand what lineCount = 1 is; in the else statement. I know what he does when I delete a statement, but I do not understand this. If I could ask someone to explain this to me, perhaps in a different way that the book will simply skip, I would really appreciate it.
#include <stdio.h> int main (void) { int num; int lineCount; printf ("\nEnter a starting number to decend between 1 and 100: "); scanf ("%d", &num); if (num > 100) num = 100; lineCount = 0; while (num >= 0) { if (lineCount < 10) lineCount++; else { printf ("\n"); lineCount = 1; // this line here is what I don't understand } printf ("%4d", num--); } return 0; }
source share