Hi so I'm new to programming and learning C programming. Im currently working on a while loop to print statements based on an input from the user. I got the input but stuck on an infinite loop of the printed material. How can i limit the loop to the number that was acquired from the user?
Code:
#define_CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
int Input;
printf("Type in a number from 1-20\n");
scanf(" %d", &Input);
while (Input) {
printf("\nGo Spartans\n");
printf("Time to start winning\n");
}
return 0;
}