Pra 2 Css
Pra 2 Css
CLASS:- CO5I(A)
ROLL NO:-532
SUBJECT:- CSS(22519)
PRACTICAL NO:- 2
Conditional Satement :-
1- If Satatement
Code:-
<html>
<head>
<title>if statment</title>
<script type="text/javascript">
var age=16;
if(age>=18)
if(age<18)
</script>
</head>
<html>
Output:-
2- If -else Statement
Code:-
<html>
<head>
<body></body>
<script>
var age=19;
if(age>=18)
else
</script>
</head>
</html>
Output:-
3) I f …ElseIf Statement
Code:-
<html>
<head>
<title>if statment</title>
<script type="text/javascript">
var one=30;
var two=20;
if(one==two)
else if(one<two)
else
}
</script>
</head>
<html>
Output:-
4) Nested If Statement
Code:-
<html>
<head>
<title>if statment</title>
<script type="text/javascript">
var one=30;
var two=20;
if(one==two)
else if(one<two)
else
{
</script>
</head>
<html>
Output:-
Code:
<html>
<head>
<script>
var i=3;
switch(i)
case 0:
case 1:
case 2:
document.write("i is two");
break;
default:
</script>
</head>
</html>
Output:-
*Looping Statement
1)For Loop
Code:-
<html>
<head>
<h3>***for Loop***</h3><br>
<body>
<script>
var i;
for(i=0;i<=10;i++)
{
</script>
</head>
</body>
</html>
Output:-
2)While Loop
Code:-
<html>
<head>
<body>
<script>
var i;
for(i=0;i<=10;i++)
}
</script>
</head>
</body>
</html>
Output:-
3) Do While Loop
Code:-
<html>
<head>
<body>
<script>
var i=1;
do {
i++;
}while(i<=5)
</script>
</head>
</body>
</html>
Output:-
Code:-
</html>
<html>
<h3>***For..in Loop***</h3>
<script>
const string="Sumedh";
for(let i in string)
document.write(string+"<br>");
</script>
</html>
Output:-