Posts

Write the simulation program for demand paging and show the page scheduling and total number of page faults according to FIFO page replacement algorithm. Assume memory of 'n' frames.

#include<stdio.h> #include<conio.h> int RefString[20],PT[10],nof,nor; void Accept() {     int i;     printf("Enter Reference String: \n");     for(i=0;i<nor;i++)     {         printf("[%d]=",i);         scanf("%d",&RefString[i]);     } } int Search(int s) {     int i;     for(i=0;i<nof; i++)         if(PT[i]==s)             return(i);     return(-1); } void FIFO() {     int i,j,k=0,Faults=0;     for(i=0;i<nor;i++)     {         gotoxy(3*i+1,2);         printf("%2d",RefString[i]);         if(Search(RefString[i])==-1)      ...

JAVA Program to create login page with Database Connectivity

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; class Framelogin extends JFrame implements ActionListener {     JTextField username;     JPasswordField password;     JLabel unm, pass;     JButton submit,clear,login;     Framelogin()     {         setTitle("Login Frame");         setSize(500,300);         setLocation(500,200);         setLayout(null);         unm=new JLabel("Username");         pass=new JLabel("Password");         username=new JTextField(20);         password=new JPasswordField(10);         submit=new JButton("Submit");         c...

JAVA Appelet program

import java.awt.*; import java.applet.*; import javax.swing.*; /* <applet code="ak" width=500 height=300> </applet> */ public class ak extends Applet     {     JLabel ak,sg;     JTextField aj,sp;         public void init()     {     ak=new JLabel("Enter Name");     sg=new JLabel("Enter LASTNAME");     aj=new JTextField(50);     sp=new JTextField(50);     setLayout(null);     add(ak);     add(aj);     add(sg);     add(sp);     ak.setBounds(30,50,100,30);     aj.setBounds(150,50,250,30);     sg.setBounds(30,100,300,30);     sp.setBounds(150,100,250,30);                        }    public void distr...

simulator program of Number is minimun or maximun greater than zero

here in this program the smaco program is given .firstly generate there opcode and save as file name dot txt (.txt).write c program accese by file handling . Opcode of program is given below 090007 090008 041007 011008 051010 100010 110000 C program is given below #include<stdio.h> #include<string.h> void main() {     FILE *fp;     char a[10]; long int b; int op; int x; int NM; register areg;        fp=fopen("op.txt","r");     while((fgets(a,4096,fp))!=NULL)        {         //puts(a);         //b='a'+0;         sscanf(a,"%ld",&b);     op=b/10000;         switch(op)         {             case 1:            ...

Simulator Program of Addition of TWO Number

we have a given smaco program .then we generate opcod of these program & it stored in a one new file dot txt(.txt) . next is write c progarmming to corresponding smaco program & opcode list. The Opcode List of Addition of Two number   030007 011007 051008 061008 051009 063009 040079 111000 The C program of Addition of Two number(of given smaco program) #include<stdio.h> #include<string.h> void main() {     FILE *fp;     char a[10]; long int b; int op; int x[2],i=0; register mem; register areg;        fp=fopen("opcode.txt","r");     while((fgets(a,4096,fp))!=NULL)        {         //puts(a);         //b='a'+0;         sscanf(a,"%ld",&b);     op=b/10000;         switch(op)       ...