Assignment 3
Assignment 3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
function calculate() {
var sum = 0;
sum += numbers[i];
</script>
</head>
<body>
<div id="result"></div>
</body>
</html>
Output:
2. Write an HTML code to find the left most vowel and reverse a number.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
function findLeftMostVowel(str) {
str = str.toLowerCase();
if (vowels.includes(str[i])) {
return i + 1;
}
return -1;
function reverseNumber(num) {
return reversed;
function testFunctions() {
</script>
</head>
<body>
<p id="outputLeftMostVowel"></p>
<p id="outputReversedNumber"></p>
</body>
</html>
Output: