Home DS , OS, DSTL Practical File Download Now DS , OS, DSTL Practical File Download Now Author - Mycollegeverse March 15, 2023 5 Download pdf of practical DS Download pdf of Operating System Download pdf of Practical DSTLOperating System CT SOLVED PAPERS: DOWNLOAD Facebook Twitter Whatsapp Newer Older
#include
ReplyDelete#include
struct FCFS
{
char p[2];
int bt,ct,tat,wt;
};
struct FCFS P[10];
void main()
{
int i,n,sum,avgtat,avgwt;
printf("Enter the number of process : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Enter name: ");
scanf("\n%s",P[i].p);
printf("Enter the burst time: ");
scanf("%d",&P[i].bt);
}
P[1].ct=P[1].bt;
for(i=2;i<=n;i++)
{
P[i].ct=P[i-1].ct+P[i].bt;
}
sum=0;
for(i=1;i<=n;i++)
{
P[i].tat=P[i].ct;
sum=sum+P[i].tat;
}
avgtat=sum/n;
sum=0;
for(i=1;i<=n;i++)
{
P[i].wt=P[i].tat-P[i].bt;
sum=sum+P[i].wt;
}
avgwt=sum/n;
printf("\n Process \t bt \t ct \t tat \t wt\n");
printf("\n --------- \t --- \t --- \t --- \t ---\n");
for(i=1;i<=n;i++)
{
printf("%s \t\t %d \t %d \t %d \t %d \n",P[i].p,P[i].bt,P[i].ct,P[i].tat,P[i].wt);
}
printf("\n Average TAT %d",avgtat);
printf("\n Average WT %d",avgwt);
printf("\n ___________________________\n");
for(i=1;i<=n;i++)
printf("| %s |",P[i].p);
printf("\n ___________________________\n");
for(i=1;i<=n;i++)
printf(" %d",P[i].ct);
getch();
}
a=int(input("enter the age: "))
ReplyDeleteb=a=int(input("enter the age: "))
c=a=int(input("enter the age: "))
if(a>b)&(a>c):
if(b>c):
print(a,b,c)
else if:
(a>b)&(a>c)
import java.util.Scanner;
ReplyDeletepublic class Main
{
public static void main(String args[])
{
int size, i, j, temp,m,t=0;
int a[] = new int[50];
Scanner scan = new Scanner(System.in);
System.out.print("enter Size : ");
size = scan.nextInt();
System.out.print("enter Array Elements : ");
for(i=0; i a[j])
{
m=a[j];
t=j;
}
}
temp = a[i];
a[i] = a[t];
a[t] = temp;
}
for(i=0; i<size; i++)
{
System.out.print(a[i]+ " ");
}
}
}
https://onlinegdb.com/DwqtWnOkW
ReplyDeletejava -12
ReplyDeletehttps://justpaste.it/70llu