I'm trying to get a program to restart when a variable is proven true like the following code.
Code:
#include <stdio.h>
#include <math.h>
int main()
{
double x;
printf("Enter a number lower than 10");
scanf("%lf",&x);
if (x > 10)
{
printf("Your number was greater than 10, try again.\n");
return(0);
}
printf("Your number, %lf, was lower than 10",x);
return(0);
}
When the number is found to be greater than 10, I want it to go back to step one to the printf("Enter a number lower than 10"). How do I do this?
Thanks.