You are on page 1of 1

<html>

<body>
<script>
do{

var n=prompt("Enter a Number:");

var ch=prompt("enter choice cube(c) and square(s)");

var n = parseInt(n);

switch(ch)

case 'c' : alert("CUBE : "+(n*n*n));

break;

case 's' : alert("SQUARE : "+(n*n));

break;

default : alert("Invalid");

var m = prompt("Do you wish to continue...(y/n)");

}while(m!='n');
</script>
</body>
</html>

You might also like