Strings – General Questions


Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

1. Which of the following function sets first n characters of a string to a given character?

A. strinit()
B. strnset()
C. strset()
D. strcset()

Correct Answer: B. strnset()
Advertisement

2. If the two strings are identical, then strcmp() function returns

A. -1
B. 1
C. 0
D. Yes

Correct Answer: C. 0
Advertisement

3. How will you print \n on the screen?

A. printf(“\n”);
B. echo “\\n”;
C. printf(‘\n’);
D. printf(“\\n”);

Correct Answer: D. printf(“\\n”);
Advertisement

4. The library function used to find the last occurrence of a character in a string is

A. strnstr()
B. laststr()
C. strrchr()
D. strstr()

Correct Answer: C. strrchr()
Advertisement

5. Which of the following function is used to find the first occurrence of a given string in another string?

A. strchr()
B. strrchr()
C. strstr()
D. strnset()

Correct Answer: C. strstr()
Advertisement

Warning: Undefined variable $in_same_cat in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Warning: Undefined variable $excluded_categories in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Leave A Comment?