63 152
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #53019 in C for sofia

Question #53019
how can i get the right output?

#include <stdio.h>


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 ;
}
}

}
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions