Study Material for Free....βœ¨πŸ’―
23 subscribers
24 photos
12 files
18 links
Download Telegram
University slips for OS
#include <stdio.h>


void swap(int *a,int *b)
{
int temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int n;
printf("Enter Number of Processes: ");
scanf("%d",&n);


int b[n],p[n],index[n];
for(int i=0;i<n;i++)
{
printf("Enter Burst Time and Priority Value for Process %d: ",i+1);
scanf("%d %d",&b[i],&p[i]);
index[i]=i+1;
}
for(int i=0;i<n;i++)
{
int a=p[i],m=i;

//Finding out highest priority element and placing it at its desired position
for(int j=i;j<n;j++)
{
if(p[j] > a)
{
a=p[j];
m=j;
}
}

//Swapping processes
swap(&p[i], &p[m]);
swap(&b[i], &b[m]);
swap(&index[i],&index[m]);
}


int t=0;

//Printing scheduled process
printf("Order of process Execution is\n");
for(int i=0;i<n;i++)
{
printf("P%d is executed from %d to %d\n",index[i],t,t+b[i]);
t+=b[i];
}
printf("\n");
printf("Process Id Burst Time Wait Time TurnAround Time\n");
int wait_time=0;
for(int i=0;i<n;i++)
{
printf("P%d %d %d %d\n",index[i],b[i],wait_time,wait_time + b[i]);
wait_time += b[i];
}
return 0;
}
<html>
<body bgcolor=black>
<form action="Slip12.php" method= "GET" >
Enter first number : <input type=text name=a ><br>
Enter second number: <input type=text name=b ><br>

Operation::
<input type=radio name=c value=1>Addition.<br>
<input type=radio name=c value=2>Subtraction.<br>
<input type=radio name=c value=3>Multiplication.<br>
<input type=radio name=c value=4>Division.<br>
<input type=submit value=ok> <input type=reset value=clear>
</form>
</body>

</html>

Slip12.php
<?php
$n1 = $_GET['a'];
$n2 = $_GET['b'];
$ch = $_GET['c'];

if($ch==1)
{
$c = $n1 + $n2;
echo"addition is: $c";
}
else if($ch==2)
{
$c = $n1 - $n2;
echo"subtraction is: $c";
}
else if($ch==3)
{
$c = $n1 * $n2;
echo"multiplication is: $c";
}
else if($ch==4)
{
$c = $n1 / $n2;
echo"Division is: $c";

}
?>
To start the (xampp) for php
import pandas as pd
import numpy as np
student = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'],
'graduation percentage': [80,70,89,55,80,66,77,55,45,88],
'age': [21, 33, 22, 23, 22, 13, 19, 17, 20, 19]}
df = pd.DataFrame(student)
print("\nMean age for each different student in data frame:")
print(df['age'].mean())
print("\nMean percentage for each different student in data frame:")
print(df['graduation percentage'].mean())
sub_name=["Ds","Python","c","java"]
sub_marks=[78,67,87,67]
plt.pie(sub_marks,labels=sub_name)
1)Filename.java ( To save the file)
2)Open Terminal
3) javac filename.java (to execute)