Computer

Arrays And Strings MCQs

Practice Arrays And Strings MCQs for competitive exams.

Arrays And Strings MCQs

Practice questions from this topic.

What does the following function returns void *memmove(void *s1,const void s2, size_t n);?

  1. A. returns the value of s1
  2. B. returns the value of s2
  3. C. doesn't return any value
  4. D. returns the value of s1 and s2
Report Error

What will be the output of the following C code? errno = 0; y = sqrt(2); if(errno == EDOM) printf("Invalid valuen"); else printf("Valid valuen");

  1. A. Invalid value
  2. B. Valid value
  3. C. No output
  4. D. Compile error
Report Error

Use . . . . . . . . to determine the null-terminated message string that corresponds to the error code errcode.

  1. A. strerror()
  2. B. strstr()
  3. C. strxfrm()
  4. D. memset()
Report Error

What will be returned in the following C code? size- t strlen(const char *s) const char *sc; for(sc = s; *sc!= ' O ' ; ++sc) return(sc - s) ;

  1. A. number of characters equal in sc
  2. B. length of string s
  3. C. doesn't return any value
  4. D. displays string s
Report Error

. . . . . . . . is reported on a domain error.

  1. A. EDOM
  2. B. ERANGE
  3. C. significance loss
  4. D. Underflow
Report Error

What is the use of function char *strchr(ch, c)?

  1. A. return pointer to first occurrence of ch in c or NULL if not present
  2. B. return pointer to first occurrence of c in ch or NULL if not present
  3. C. return pointer to first occurrence of ch in c or ignores if not present
  4. D. return pointer to first occurrence of cin ch or ignores if not present
Report Error

This function offers the quickest way to determine whether two character sequences of the same known length match character for the character up to and including any null character in both.

  1. A. strcmp()
  2. B. memcmp()
  3. C. strncmp()
  4. D. no such function
Report Error

Which among the following option is the full set of character class Hexadecimal digits?

  1. A. { 0 1 2 3 4 5 6 7 8 9 A B C D E F }
  2. B. { 0 1 2 3 4 5 6 7 8 9 a b c d e f }
  3. C. { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f }
  4. D. { 0 1 2 3 4 5 6 7 8 9}
Report Error

Which function will you choose to join two words?

  1. A. strcpy()
  2. B. strcat()
  3. C. strncon()
  4. D. memcon()
Report Error

Functions whose names begin with "strn"

  1. A. manipulates sequences of arbitrary characters
  2. B. manipulates null-terminated sequences of characters
  3. C. manipulates sequence of non - null characters.
  4. D. returns a pointer to the token
Report Error

The . . . . . . . . function converts an uppercase letter to the corresponding lowercase letter.

  1. A. islower()
  2. B. isupper()
  3. C. toupper()
  4. D. tolower()
Report Error

ERANGE is reported on an overflow or an underflow.

  1. A. true
  2. B. false
Report Error