Hi all, My question may sound silly but please bear with me , I am new at this. I am having trouble making a for loop output what I would like it to output.
In my code, the age of the user is passed as the second argument If the user is over 20 years old, I want to output "boy are you old!" once for year old over 20 that the user is.
Here is my code, the for loop I have only outputs the message once if the user enters a number 20 or over.
main (int argc, char **argv)
int n, age;
n = strlen(argv);
if (n < 5)
printf("Your name is short\n");
printf("Your name is long\n");
age = atoi(argv);
for (age = 20; age < 100; ++age);
printf("boy are you OLD!\n");
Thanks a lot.