take an inputof alphabet from the user and check if it is vowel or nor and ask user to type 1 to quit and any other no. to continue .and repeat the prosess until user terminaters the program
Answers
Code: [in Python language]
[tex]\tt while\ True:\\ {\ \ \ \ \ }a\ =\ in put("Enter\ a\ letter:\ ")\\ {\ \ \ \ \ }if\ a\ in\ "AEIOUaeiou":\\ {\ \ \ \ \ }{\ \ \ \ \ }print("It's\ a\ vowel.")\\ {\ \ \ \ \ }else:\\ {\ \ \ \ \ }{\ \ \ \ \ }print("It's\ not\ a\ vowel.")\\ {\ \ \ \ \ }print()\\ {\ \ \ \ \ }c\ =\ in put("Enter\ '1'\ if\ you\ want\ to\ quit\ or\ any\ other\ number\ to\ continue:\ ")\\ {\ \ \ \ \ }print()\\ {\ \ \ \ \ }if\ c\ ==\ "1":\\ {\ \ \ \ \ }{\ \ \ \ \ }break\\ {\ \ \ \ \ }else:\\ {\ \ \ \ \ }{\ \ \ \ \ }continue[/tex]
Explanation:
We use a loop to keep the program running. The letter is retrieved and stored into the variable 'a', using the function. We then use a conditional statement to check if the letter is a vowel or not. After the appropriate message is displayed, we use another variable, 'c', to store the response of the user as to whether or not he/she wants to continue. The value of 'c', is again tested using a conditional statement and the program continues accordingly.
The program has been attached above. Kindly check it!
After typing any number other than 1, this program will run as long the given statement (u==0) is true.