Vidyalelo
C Programming · Q52

Arrays and Strings

Programming · C Programming · question 52

Q52

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

A.
laststr()
B.
strstr()
C.
strnstr()
D.
strrchr()
Answer
E.
None of these

Answer: Option D

Solution

Answer: Option D
Solution:

Declaration: char *strrchr(const char *s, int c);

It scans a string s in the reverse direction, looking for a specific character c.