Q1. Write a java script program to accept a number
from user and check whether it is Armstrong number or not.
<html>
<head>
<script>
function armstr()
{
var arm=0,a,b,c,d,num;
num=Number(document.getElementById("no_input").value);
temp=num;
while(temp>0)
{
a=temp%10;
temp=parseInt(temp/10); //
convert float into Integer
arm=arm+a*a*a;
}
if(arm==num)
{
alert("Armstrong
number");
}
else
{
alert("Not Armstrong
number");
}
}
</script>
</head>
<body>
Enter any Number: <input
id="no_input">
<button
onclick="armstr()">Check</button></br></br>
</body>
</html>
Q2. Create HTML web page with following
specifications
i)Title should be about your
College.
ii)Put image in the
background
iii)Place your college name
at the top of page in large text followed by address in smaller size.
iv)Add names of courses
offered, each in different color, style and font
v)Add scrolling text about
college.
vi)Add any image at the
bottom. (use External CSS to format the webpage)
a.css
h1 {
color: navy;
margin-left: 20px;
font-size:30px;
}
body{background:url('1.jpg')}
h2{font-size:20px; color:red;font-family:Arial;}
h4{font-size:10px;color:green;font-family:verdana;}
a.html
<html>
<head><link rel="stylesheet"
type="text/css" href="a.css"></head>
<body>
<h1><center ><h1>FORESIGHT</h1></center></h1>
<center><h6>Pune near ymca
campus</h6></center>
<h2>COURSE</h2>
<h4>BCA</h4>
<ul type="disc">
<li>fybca</li>
<li>sybca</li>
<li>tybca</li>
</ul>
<h4>BBA</h4>
<ul type="disc">
<li>fybba</li>
<li>sybba</li>
<li>tybba</li>
</ul>
<h4>BCOM</h4>
<ul type="disc">
<li>fybcom</li>
<li>sybcom</li>
<li>tybcom</li>
</ul>
<marquee>Foresight college of Commerce,Pune
</marquee>
<img src="images.jpg" height="40%"
width="50%">
</body>
</html>