mercredi 21 février 2018

what to do in order to get this output

int main(void)
{
    string argv = get_string("enter a string: ");

     for (int i = 0; i < strlen(argv); i++)
     {
         printf("%c\n", argv[i]);
     }

    for (int j = 0; j < strlen(argv); j++)
    {
        if (isupper(argv[j]) == true)
        {
            printf("%c\n", argv[j]);
        }


        if else(isupper(argv[j]) == false)
        {
            printf("No\n");
        }
    }
}

Simple question : Why do you thin guys I got a output like :

M
n
No

When I input Mn

Instead of this output:

M
n
M
No

Aucun commentaire:

Enregistrer un commentaire