0
Please I need help to output the names that end with letter character 'y'' I've tried manipulating the for loop, but no output
4 Answers
+ 1
change the if condition to this:
strlen() will find the length of the string
and subtract 1 from it to get the last index of the string
if( nm[i][ strlen( nm[i] ) - 1 ] == ch) {
+ 1
Here is your fixed code
https://code.sololearn.com/c2Z8Wx1IiZXm/?ref=app
Simply add another for loop for iteration 2d array
+ 1
AZHAGESAN S thanks am grateful.
0
Sami Khan thanks alot I seen my error, I just have learn more on how to express conditionals with string functions