Because Daniweb has rules. Specifically: "Do provide evidence of having done some work yourself if posting questions from school or work assignments"
Your problem is clearly a basic exercise intended for learning, and thus constitutes homework. Therefore we expect a certain measure of effort on your part before offering help. If we did the work for you, you'd learn nothing.
You're testing z[i], which is an array rather than a string. Try this instead:
for (i = 0; i < 3; i++)
for (j = 0; z[i][j] != '\0'; j++)
if (z[i][j] == 'a')
Note that the outer loop only goes through the number of strings you actually input, this is important if you don't initialize all of the strings to be blank. The inner loop only searches the contents of the string (which ends with a '\0' character in a valid string). Finally, the condition checks the characters in each string as you're using an array of arrays of char.
All strlen does is search for a '\0' character, so it's more efficient to simply do that yourself as in my example in a previous post. This is assuming the string is valid in the first, place, of course. ;)
int n, count = 0;
printf("Enter the no of characters present in an array \n ");
printf(" Enter the string of %d characters \n" , n);
while (count < n)
printf(" %c = %d\n", string[count], string[count] );
++ count ;