0% found this document useful (0 votes)
13 views3 pages

CSS - Exp 1 - PDF - UPDATED MONDAY

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

CSS - Exp 1 - PDF - UPDATED MONDAY

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Ansari Abdullah Roll no: 220402

Sub: Client-Side Scripting (CSS) Branch: CO

Experiment No. 1: Write simple JavaScript with HTML for arithmetic


expression evaluation and message printing
▪ Write a program to print “Hello World”

CODE:
<html>
<head>
<title> Exp1.1 </title>
<script>
document.write("Hello World!");
document.write("<hr>")
document.write("220402-Ansari Abdullah");
</script>
</head>
</html>

OUTPUT:
▪ Write a program to take username as input and print it

CODE:
<html>
<head>
<title> Exp1.2 </title>
<script>
var m=prompt("Enter your Name: ");
document.write("Your Name is "+m);
document.write("<br>");
document.write("220402-Ansari Abdullah");
</script>
</head>
</html>

OUTPUT:
▪ Write a program for arithmetic expression evaluation and message printing

CODE:
<html>
<head>
<title> Exp1.3 </title>
<script>
var a=parseInt(prompt("Enter 1st No: "));
var b=parseInt(prompt("Enter 2nd No: "));
var c=a+b;
alert("Addition: "+c);
</script>
</head>
</html>

OUTPUT:

You might also like