Problem 27

5 comments on “Problem 27”


  • Rishav Raj Singh

    #include
    int main()
    {
    char s[1000];
    int i;
    printf(“Enter a string: “);
    scanf(“%s”, s);
    for(i = 0; s[i] != ‘\0’; ++i);
    printf(“Length of string: %d”, i);
    return 0;
    }


  • Angel Ashu

    #include

    int main()
    {
    char s[1000];
    int c = 0;

    printf(“Input a string\n”);
    gets(s);

    while (s[c] != ‘\0’)
    c++;

    printf(“Length of the string: %d\n”, c);

    return 0;
    }