| Ex No: 3 | COUNT VOWELS |
|---|---|
| Aim: | To write a JavaScript code to count number of vowels in a string. |
| Algorithm | |
| Step1: Create a folder “Ex3” to place the HTML files. | |
| Step2: Create HTML file “index.html”. | |
| Step3: Add JavaScript code to get the value of text input. | |
| Step4: Use javascript for loop and switch statement to count vowels in the string. | |
| Step5: Using JavaScript display the result in a label. | |
| Source Code | |
index.html
|
|
| Result: | Thus JavaScript code is written to count number of vowels in a string and display the result. |