Length Of A String

Post-Test

  1. What is the output of C Program with String Arrays.?
  2. int main()
    {
    char p[] = "GODZILLA";
    int i=0;
    while(p[i] != '\0')
    {
    printf("%c",*(p+i));
    i++;
    }
    }


    G
    GODZILLA
    Compile error
    None of the Above

  3. What is the output of C Program with String arrays.?
  4. int main()
    {
    char *p1 = "GOAT";
    char *p2;
    p2 = p1;
    p2="ANT";
    printf("%s", p1);
    }


    ANT
    GOAT
    G
    A

  5. What is the output of C Program?

  6. int main()
    {
    char *p1 = "GOAT";
    char *p2;
    p2 = p1;
    printf("%s", p2);
    }

    G
    GOAT
    Compile Error
    None Of the Above

  7. Choose a correct C Statement about Strings.

  8. PRINTF is capable of printing a multi word string.
    PUTS is capable of printing a multi word string.
    GETS is capable of accepting a multi word string from console or command prompt
    All the above

  9. How do you accept a Multi Word Input in C Language.?

  10. SCANF
    GETS
    GETC
    FINDS