I cannot figure out why am I getting these results?
I'm currently only trying to validate the Numeric Key when typing 20x as a command-line argument get Usage: ./caesar Key
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main (int argc, string argv[])
{
int Key = (int)argv[1];
if (argc == 2)
{
for (int i = 0, n = strlen(argv[1]); i < n; i++)
{
if (argv[1][i] >= 48 && argv[1][i] <= 57)
{
printf("Success\n");
printf("%s\n", argv[1]);
}
else
{
printf("Usage: ./caesar Key\n");
return 1;
}
}
}
else
{
printf("Usage: ./caesar Key\n");
}
}