Ok, here's my entire program. It runs perfectly fine besides automatically closing after it runs, but if you have any other suggestions those would be greatly appreciated as well.
Code:
#include <stdio.h>
int ask(void);
int main(void);
int age;
int ask(void)
{
printf("Please enter your age.\n");
scanf("%d",&age);
return 0;
}
int main(void)
{
ask();
if(age < 0) {
printf("You can't have a negative age!\n\n");
ask();
}
else if(age > 0 && age < 90) {
printf("You are less than 90 years old.\n");
}
else {
printf("Wow, you're pretty old!\n");
}
getchar();
return 0;
}