# 4. VTU WEB TECHNOLOGY LAB | READ NOW

VTU WEB TECHNOLOGY LAB

4] DEVELOP AND DEMONSTRATE A HTML5 FILE THAT INCLUDES JAVASCRIPT SCRIPT THAT USES FUNCTIONS FOR THE FOLLOWING PROBLEMS

1. PARAMETER: A STRING
2. OUTPUT: THE POSITION IN THE STRING OF THE LEFT-MOST VOWEL
3. PARAMETER: A NUMBER
4. OUTPUT: THE NUMBER WITH ITS DIGITS IN THE REVERSE ORDER

## STEPS TO EXECUTE HTML PROGRAM

1. Copy the html code given below
2. Save it with .html file name extension
3. Click double click on your saved html file
4. Exection successfull

## Solution 1 – [prog4.html]

```<script>
var a = prompt("Enter The Query"),b = parseInt(a),z=0;
if(b) {
while(b>0)
var r= b%10, z= z*10+r, b = Math.floor(b/10);
document.write("Entered Query : "+ a +"<br> Given Number In Reverse Order : "+ z);
}
else {
a = a.search(/[aeiouAEIOU]/);
document.write("The First Occurence Of Vowel is at : "+ (a+1));
}
</script>```

## WEB TECHNOLOGY Solution 2 – [ prog4.html]

```<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">
var str = prompt("Enter the Input","");
if(!(isNaN(str)))
{
var num,rev=0,remainder;
num = parseInt(str);
while(num!=0) {
remainder = num%10;
num = parseInt(num/10);
rev = rev * 10 + remainder;
}
}
else
{
str = str.toUpperCase();
for(var i = 0; i < str.length; i++) {
var chr = str.charAt(i);
if(chr == 'A' || chr == 'E' || chr == 'I' || chr == 'O' || chr == 'U')break;
}
if( i < str.length )
alert("The position of the left most vowel is "+(i+1));
else
alert("No vowel found in the entered string");
}
</script>
</body>
</html>```