Problem 27

6 comments on “Problem 27”


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