Problem 27

8 comments on “Problem 27”


  • shushank

    Python

    s=input()
    l=list(s)
    c=0
    i=0
    l.append(” “)
    while l[i]!=’ ‘:
    c+=1
    i+=1
    print(c)


  • anilreddy

    #include
    #include
    int main()
    {
    int i,count = 0;
    char s[6];
    printf(“enter the string”);
    gets(s);
    for(i=0;s[i]!=’\0′;i++){
    count = count+1;
    }
    printf(“%d”,count);
    }


  • SWATI

    import java.util.*;
    public class Main
    {
    public static void main(String[] args) {

    char arr[]=args[0].toCharArray();
    int i=0;
    for(char c:arr)
    {

    System.out.println(“Hello World “+arr[i]);
    i++;
    }
    System.out.println(“String length “+i);
    }
    }


  • 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;
    }