0

Please help to understand why at any values of argv[1] the terminal displays "Duble."

#include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

int main(int argc, string argv[])
{
    for (int i = 0, len = strlen(argv[1]); i < len; i++)
    {
        for (int n = 1; n < len + 1; n++)
        {
            if ((int) argv[1][i] - (int) argv[1][i + n] == 0)
            {
                printf("Duble.\n");
                return 1;
            }
        }
    }
} 
1

You must log in to answer this question.

Browse other questions tagged .