Hello, Im taking C in school, and i have a problem with my code, nothing happens at all when i run the program.
The task is:
A program is required that prompts the user for a number. The program will then print a series of asterisks to represent the number. If the user enters a number less than 1, the program stops. For example:
Enter a number: 5
*****
Enter a number: 3
***
Enter a number: 9
*********
Enter a number: 0
i have decided to use while loop since its a pretest loop
here it is
#include<stdio.h>
main()
{
int num, i;
while(num>1)
{
printf("Enter a number:");
scanf("%d", &num);
while(i<=num)
{
printf("*");
i++;
}
}
}
any help would be apreciated!!!