This program takes a character as input and searches for it in a string using a while loop. It prints either "Found character c at position x" or "Character c not found" depending on if the character is in the string. The key steps are:
1) Take character input and set variables for search string and index
2) Initialize a while loop to iterate through the string, incrementing the index until the character is found or the string ends
3) If found, print message with character and position. If not found, print message.
4) End program.
This program takes a character as input and searches for it in a string using a while loop. It prints either "Found character c at position x" or "Character c not found" depending on if the character is in the string. The key steps are:
1) Take character input and set variables for search string and index
2) Initialize a while loop to iterate through the string, incrementing the index until the character is found or the string ends
3) If found, print message with character and position. If not found, print message.
4) End program.
This program takes a character as input and searches for it in a string using a while loop. It prints either "Found character c at position x" or "Character c not found" depending on if the character is in the string. The key steps are:
1) Take character input and set variables for search string and index
2) Initialize a while loop to iterate through the string, incrementing the index until the character is found or the string ends
3) If found, print message with character and position. If not found, print message.
4) End program.
This program takes a character as input and searches for it in a string using a while loop. It prints either "Found character c at position x" or "Character c not found" depending on if the character is in the string. The key steps are:
1) Take character input and set variables for search string and index
2) Initialize a while loop to iterate through the string, incrementing the index until the character is found or the string ends
3) If found, print message with character and position. If not found, print message.
4) End program.