Class 6 Exam  >  Class 6 Tests  >  C Programming for Beginners  >  Test: C String Operations - Class 6 MCQ

Test: C String Operations - Class 6 MCQ


Test Description

15 Questions MCQ Test C Programming for Beginners - Test: C String Operations

Test: C String Operations for Class 6 2024 is part of C Programming for Beginners preparation. The Test: C String Operations questions and answers have been prepared according to the Class 6 exam syllabus.The Test: C String Operations MCQs are made for Class 6 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: C String Operations below.
Solutions of Test: C String Operations questions in English are available as part of our C Programming for Beginners for Class 6 & Test: C String Operations solutions in Hindi for C Programming for Beginners course. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free. Attempt Test: C String Operations | 15 questions in 10 minutes | Mock test for Class 6 preparation | Free important questions MCQ to study C Programming for Beginners for Class 6 Exam | Download free PDF with solutions
Test: C String Operations - Question 1

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

Detailed Solution for Test: C String Operations - Question 1

The given code char *strchr(ch, c) return pointer to first occurrence of c in ch or NULL if not present.

Test: C String Operations - Question 2

Which function will you choose to join two words?

Detailed Solution for Test: C String Operations - Question 2

The strcat() function is used for concatenating two strings, appends a copy of the string.
char *strcat(char *s1,const char *s2);

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: C String Operations - Question 3

The______ function returns the number of characters that are present before the terminating null character.

Detailed Solution for Test: C String Operations - Question 3

The strlen() function is used to return the number of characters that are present before the terminating null character.size-t strlen(const char *s);The length of the string pointed to by s is computed by strlen().

Test: C String Operations - Question 4

What will the given C code do?

int memcmp(const void *str1, const void *str2, size_t n)

Detailed Solution for Test: C String Operations - Question 4

In the C library function int memcmp(const void *str1, const void *str2, size_t n)) is used to compare the first n bytes of memory area str1 and memory area str2.

Test: C String Operations - Question 5

Which among the given options compares atmost n characters of string ch to string s?

Detailed Solution for Test: C String Operations - Question 5

int strncmp(ch, s, n) is used to compare at most n characters of string ch to string s; return <0 if ch0 of ch >s.

Test: C String Operations - Question 6

What will strcmp() function do?

Detailed Solution for Test: C String Operations - Question 6

The strcmp() function compares the string s1 to the string s2.
int strcmp(const char *s1,const char *s2);

Test: C String Operations - Question 7

void *memcpy(void *dest, const void *src, size_t n) What does the following code do?

Detailed Solution for Test: C String Operations - Question 7

In the C library function memcpy() is used to copy n characters from memory area src to memory area dest.

Test: C String Operations - Question 8

Which of the following is the right syntax to copy n characters from the object pointed to by s2 into the object pointed to by s1?

Detailed Solution for Test: C String Operations - Question 8

The memcpy() function copies n characters from the object pointed to by s2 into the object pointed to by s1. If copying takes place between objects that overlap, the behavior is undefined.

Test: C String Operations - Question 9

Which of the following is the variable type defined in header string. h?

Detailed Solution for Test: C String Operations - Question 9

This is the unsigned integral type and is the result of the sizeof keyword.

Test: C String Operations - Question 10

Which of the given function is used to return a pointer to the located character?

Detailed Solution for Test: C String Operations - Question 10

The strchr() function is used to return a pointer to the located character if character does not occur then a null pointer is returned.

Test: C String Operations - Question 11

Which among the given options is the right explanation for the statement size_t strcspn(c, s)?

Detailed Solution for Test: C String Operations - Question 11

The function size_t strcspn(c, s) is used to return length of prefix of c consisting of characters not in s.

Test: C String Operations - Question 12

What is the prototype of strcoll() function?

Detailed Solution for Test: C String Operations - Question 12

The prototype of strcoll() function is int strcoll(const char *s1,const char *s2).

Test: C String Operations - Question 13

Which of the following function returns a pointer to the located string or a null pointer if string is not found.

Detailed Solution for Test: C String Operations - Question 13

The strstr() function is used to return a pointer to the located string, or if string is not found a null pointer is returned.

Test: C String Operations - Question 14

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

Detailed Solution for Test: C String Operations - Question 14

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

Test: C String Operations - Question 15

There are two groups of string functions defined in the header <string.h>. What are they?

Detailed Solution for Test: C String Operations - Question 15

There are two groups of string functions declared under the header <string.h>. The first have names beginning with str and second have names beginning with mem.

10 videos|13 docs|15 tests
Information about Test: C String Operations Page
In this test you can find the Exam questions for Test: C String Operations solved & explained in the simplest way possible. Besides giving Questions and answers for Test: C String Operations, EduRev gives you an ample number of Online tests for practice

Top Courses for Class 6

10 videos|13 docs|15 tests
Download as PDF

Top Courses for Class 6