Reverse Of A String

Pre-Test

  1. a) What is a String in C Language.?

  2. String is a new Data Type in C
    String is an array of Characters with null character as the last element of array.
    String is an array of Characters with null character as the first element of array
    String is an array of Integers with 0 as the last element of array.

  3. Choose a correct statement about C String.
    char ary[]="Hello..!";

  4. Character array, ary is a string.
    ary has no Null character at the end
    String size is not mentioned
    String can not contain special characters.

  5. What is the Format specifier used to print a String or Character array in C Printf or Scanf function.?

  6. %c
    %C
    %s
    %w

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

  8. int main()
    {
    char ary[]="Discovery Channel";
    printf("%s",ary);
    return 0;
    }

    D
    Discovery Channel
    Discovery
    Compile Error

  9. What is the output of C Program with Strings.?

  10. int main()
    {
    char str[]={'g','l','o','b','e'};
    printf("%s",str);
    return 0;
    }

    g
    globe
    globe\0
    D) None of the above