Reverse Of A String

Post-Test

  1. What is the output of C Program with Strings.?
  2. int main()
    {
    char str[]={'g','l','o','b','y','\0'};
    printf("%s",str);
    return 0;
    }
    /

    g
    globe
    globe\0
    Compiler error

  3. How do you convert this char array to string.?
    char str[]={'g','l','o','b','y'};

  4. str[5] = 0;
    str[5] = '\0'
    str[]={'g','l','o','b','y','\0'};
    All the above

  5. What is the output of C Program?

  6. int main()
    {
    int str[]={'g','l','o','b','y'};
    printf("A%c ",str);
    printf("A%s ",str);
    printf("A%c ",str[0]);
    return 0;
    }

    A A A
    A Ag Ag
    A*randomchar* Ag Ag
    Compiler error

  7. What is the output of C Program with arrays.?

  8. int main()
    {
    char str[]={"C","A","T","\0"};
    printf("%s",str);
    return 0;
    }

    C
    CAT
    CAT\0
    Compile error

  9. What is the maximum length of a C String.?

  10. 32 characters
    64 Characters
    256 characters
    None of the above