Il 0% ha trovato utile questo documento (0 voti)
4 visualizzazioni23 pagine

Ganesh CSS 1 To 8

Css output

Caricato da

mayur
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato DOCX, PDF, TXT o leggi online su Scribd
Il 0% ha trovato utile questo documento (0 voti)
4 visualizzazioni23 pagine

Ganesh CSS 1 To 8

Css output

Caricato da

mayur
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato DOCX, PDF, TXT o leggi online su Scribd
Sei sulla pagina 1/ 23

Name :Ganesh Chandrakant Zore Roll no:92

1st Practical of CSS


Write simple js with html for arithmetic expression evaluate and
message printing.
Name :Ganesh Chandrakant Zore Roll no:92

Practical 2nd of CSS

Condintional statement

1] If-else

<script>

var a=parseInt(prompt("enter the number that are check to even and odd")); if(a

%2==0)

document.write(a+" is even");

else

document.write(a+" is odd");

</script>

Output:

2] If-else Ladder
<script>

var a=parseInt(prompt("enter the First number :"));


var b=parseInt(prompt("enter the Second number :"));
var c=parseInt(prompt("enter the Third number :"));
if(a>b&&a>c)
document.write(a+" is largest");
else if(b>c)
document.write(b+" is largest");
else
document.write(c+" is largest");

</script>

Output :

3] Switch case
<script>

var day;
day=parseInt(prompt("enter the day between 1-7"));

switch(day){

case 1:
document.write("monday");
break;
case 2:
document.write("tuesday");
break;
case 3:
document.write("wednesday");
break;
case 4:
document.write("thursday");
break;
case 5:
document.write("friday");
break;

case 6:
document.write("saturday");
break;
case 7:
document.write("sunday");
break;
default:

document.write("enter the valid day");


}

</script>
Output:

Looping statements
1]for loop
<script>

for(var i=1;i<=10;i++){

document.write("<br>"+i);
}

</script>
Output:

2] While-loop
<script>
var a;
a=1;
document.write("using while loop");
while(a<=30){
document.write("<br>"+a); a+
+;
};

</script>
Output:

3] Do-while
<script>
var a;
a=1;
document.write("using do while loop");
do{
document.write("<br>"+a); a+
+;
}while(a<=20);

</script>
Output:

Extra programs
1]factorial
<script>
var num=parseInt(prompt("enter a number"));
var fact=1;
for(var i=1;i<=num;i++){
fact=fact*i;
}
document.write("factorial of given number is "+fact);

</script>
Output:
2] Fibonacci series
<script>
var num1=1,num2=2,num3;
var limit=parseInt(prompt("enter the limit"));
document.write("<br> fibonacci series:");
document.write("<br>"+num1+"<br>"+num2);
for(var i=1;i<limit;i++)
{num3=num1+num2;
document.write("<br>"+num3);
num1=num2;
num2=num3;
}
</script>
Output:

3] calculator
<script>
var a,b,c;
a=parseInt (prompt("enter the first number"));
b=parseInt (prompt("enter the second number"));
c=prompt("enter the operation do you perfom like +,-.*,/");
switch(c){
case "+":
document.write("addition is:"+(a+b));
break;
case "-":
document.write("Sub is:"+(a-b));
break;
case "*":
document.write("Mul is:"+(a*b));
break;
case "/":
document.write("Div is:"+(a/b));
break;

default:

document.write("enter the valid operation");


}

</script>
Output:
Name :Ganesh Chandrakant Zore Roll no:92

Practical 3rd

of CSS Array functionality


Array simple code
Eg 1]
<html>

<body>

<script>

var i;

var emp=new Array();

emp[0]="mayur";

emp[1]="onkar";

emp[2]="ganesh";

for(i=0;i<emp.length;i++){

document.write("<br>"+emp[i]);

</script>

</body>

</html>

Output:
Eg 2]
<html>
<body>
<script>

var i;
var emp=["onkar","mayur","ganesh","balaji"];
for(i=0;i<emp.length;i++){

document.write("<br>"+emp[i]);
}
</script>

</body>
</html>
Output :

Extra Programs:
1] Perform Array function
<script>
var array=new Array();
array[0]=12;
array[1]=67;
array[2]=22;
array[3]=44;
array[4]=30;
var s=array.sort();
document.write("sorted array :"+s);
var s=array.sort();
var c=s.reverse();
document.write("<br>revers array :"+c);
var i=array.indexOf(22);
document.write("<br>index of 67:"+i);
var l=s.lastIndexOf(22)
document.write("<br>last index of 22:"+l);

//var m=array.find(44);
//document.write("<br>after find :"+m);
array.push(33,54);
document.write("<br>after push :"+array);

array.unshift(65,66);
document.write("<br>after unshift :"+array);

array.pop();
document.write("<br>after pop :"+array);
array.shift();
document.write("<br>after shift :"+array);
</script>

Output:

2] Array push and pop operation


<script>
var a=new Array(1,2,3,4,"mayur");
document.write("array is:"+a);
a.push("onkar",5,6,7,55.55);
document.write("<br>array after push:"+a);
a.pop();
document.write("<br>array after pop:"+a);
var s=a.sort();
document.write("<br>array after sort:"+s);
s.reverse();
document.write("<br>array after reverse is:"+s);

</script>
Output:
2]shift and unshift methods.
<script>
var a=new Array(1,2,3,4,5);
document.write("array is:"+a);
a.shift();
document.write("<br>array after shift:"+a);
a.unshift();
document.write("<br>array after unshift:"+a);

</script>

Output:
Name :Ganesh Chandrakant Zore Roll no:92

Practical 4th of CSS

Functions:
Eg 1]
<html>

<script>

function msg(){

alert("Hello");

</script>

<body>

<input type="button" onclick="msg()"value="call function"/>

</body>

</html>

Output:

Eg 2]
<html>
<script>
var a=parseInt(prompt("enter the number that you want to make the
cube")); function cube(p){

var c=p*p*p;
alert("cube is :"+c);
}
function sq(r){

var k=r*r;
alert("cube is :"+k);
}

</script>
<body>
<input type="button" onclick="cube(a)" value="find the cube" />
<input type="button" onclick="sq(a)" value="find the square" />
</body>
</html>
Output :

Cube and square:

Eg.Return function:

<html>
<body>

<script>
function getinfo(){

return "hello javatpoint!point hoe ru";}


</script>
<script>
document.write(getinfo());
</script>

</body>
</html>

Output:

Eg.function object

<html>
<body>

<script>
var add=new Function ("num1","num2","return num1+num2");
document.writeln("addition is:"+add(5,10));

</script>

</body>
</html>

Output:
Name :Ganesh Chandrakant Zore Roll no:92

Practical 5th of CSS


Name :Ganesh Chandrakant Zore Roll no:92

Practical 7th of CSS


Practical 8th of CSS
Practical no:6

<!DOCTYPE html>
<html>
<head>
<title>Admission Form</title>
</head>
<body>
<h2>Admission Form</h2>
<form>
<label for="fullName">Full Name:</label>
<input type="text" id="fullName" name="fullName"><br><br>

<label for="address">Address:</label><br>
<textarea id="address" name="address" rows="4" cols="50"></textarea><br><br>

<label for="department"> department name:</label>


<select id="department" name="department"
<option value="">select department </option>
<option value="">Computer Engineering</option>

<option value="">Electrical Engineering</option>

</select><br><br>

<label for="year">Year of Admission:</label>


<select id="year" name="year">
<option value="">select year</option>

<option value="">SY</option>
<option value="">TY</option>

</select><br><br>

<label>Subject:</label><br>
<input type="checkbox" id="java" name="subject" value="JAVA">
<label for="java">JAVA</label>
<input type="checkbox" id="html" name="subject" value="HTML">
<label for="html">HTML</label>
<input type="checkbox" id="javascript" name="subject" value="JavaScript">
<label for="javascript">JavaScript</label>
<input type="checkbox" id="php" name="subject" value="PHP">
<label for="php">PHP</label>
<input type="checkbox" id="cpp" name="subject" value="C++">
<label for="cpp">C++</label><br><br>

<label>Gender:</label><br>
<input type="radio" id="male" name="gender" value="Male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="Female">
<label for="female">Female</label>
<input type="radio" id="other" name="gender" value="Other">
<label for="other">Other</label><br><br>

<label>Caste:</label><br>
<input type="radio" id="open" name="caste" value="Open">
<label for="open">Open</label>
<input type="radio" id="obc" name="caste" value="OBC">
<label for="obc">OBC</label>
<input type="radio" id="nt" name="caste" value="NT">
<label for="nt">NT</label><br><br>

<label for="certification">Certification:</label>
<input type="text" id="certification" name="certification"><br><br>

<button type="submit">Submit</button>
</form>
</body>
</html>

Potrebbero piacerti anche