Posts

Showing posts from November, 2019

IOT

Image

OS

Twin_Prime.py from threading import Thread class TwinPrime(Thread): def __init__(this,a,b): Thread.__init__(this) this.a, this.b = a, b def prime(this,n): for i in range(2,n//2+1): if(n%i==0): return False return True def run(this): if(this.b-this.a==2): if (this.prime(this.a) and this.prime(this.b)): print("Twin Prime") return print("Not Twin Prime") a=int(input("Enter First number: ")) b=int(input("Enter Second number: ")) TwinPrime(a,b).start() Shortest Job First.py #sjf class node: def __init__(this, pid, burst): this.pid = pid this.burst = burst sequence = input("enter the sequence delimited by whitespace ").split(" ") nodes = [] waiting = [0] for i in range(0,len(sequence)): nodes.append(node(i+1,int(sequence[i]))) for i in range(0,len(sequence)): ...

WEB PRACTICALS

Practical1a.html AIM: Design a webpage that make use of document structure tag. <HTML> <Head> <title> Document structure tags </title> </Head> <body bgcolor="Red"> <Header> Header of web page </Header> <Br/> <Br/> <hr/> <p> This is simple web page </p> <Br/> <Br/> <hr/> <Footer> Created Date:13-07-19 </Footer> </body> </HTML> Practical1b.html AIM: Design web page that make use of various text formatting tags. <HTML> <head> <title> Text formatting tags </title> </head> <body bgcolor="#00FF00"> <H1 align="center"> <B> <I> Student Info </I> </B> </H1> <Br/> <Br/> <hr/> <font face="Arial" color="Red" size="10"> Name:<big> Abc </big> <Br/> <font face="verdana...

JAVA PRACTICALS

JAVA PRACTICALS AddMatrix.java import java.util.Scanner; public class AddMatrix { public static void main (String args[]) { int p,q,m,n; Scanner s=new Scanner(System.in); System.out.println("enter no. of rows for 1st matrix"); p=s.nextInt(); System.out.println("enter no. of cols for 1st matrix"); q=s.nextInt(); System.out.println("enter no. of rows for 2nd matrix"); m=s.nextInt(); System.out.println("enter no. of cols for 2nd matrix"); n=s.nextInt(); if(p==m && q==n) { int a[][]=new int[p][q]; int b[][]=new int[m][n]; int c[][]=new int[m][n]; System.out.println("enter elements for 1st matrix"); for(int i=0;i<p;i++) { for(int j=0;j<q;j++) { a[i][j]=s.nextInt(); } } System.out.println("enter elements for 2nd matrix"); for(int i=0;i<m;i++) { for(int j=0;j<n;j++) { b[i][j]=s.nextInt(); } } System.out.println("the 1st matrix"); for(int i=0;i<p;i++) { ...