Hi, I am trying to make a program that asks a user to enter a speed. The speed shoud be a positive int. How do I make it if a user enters say xyz, a message will say invalid input?
eg
int speed = 0;
printf("Please enter a speed: "); --------user inputs xyz
scanf("%d%", &speed);
printf("Speed equals %d%", speed); ----the output would be 0
is there a way to make it recognize xyz or whatever?
Thanks heaps fo any info