Vidyalelo
C Programming · Q77

Arrays and Strings

Programming · C Programming · question 77

Q77

What will the following C code do? char * strrchr(const char *s, int c ) char ch = c; char *sc; for(sc = NULL; ; ++s) if(*s == ch) SC = 9; i f (*s ==' ' ) return (( char *) s);

A.
find last occurrence of c in char s[ ].
Answer
B.
find first occurrence of c in char s[ ].
C.
find the current location of c in char s[ ].
D.
There is error in the given code

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board