int main( )
{
char status[] = {'s','i','m','p','l','e' } ;
char i, x ;
printf ( "Enter character to search: " ) ;
scanf ( "%c", &x ) ;
for(i=0;i<=5;i++)
{
if ( status[5] < x || status[i] >= x )
{
if ( status[5] == x)
printf ( "The character is at position %d in the array.", i ) ;
else
printf ( "character is not present in the array." ) ;
break ;
}
}
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-53019.pdf
Comments
Leave a comment