download

24 Comments

C program for Pass-1 Assembler

C program for Pass-1 Assembler #include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> int symi=0,lc=0,len=1,dc=0,start=0; struct pgm { char line[80]; } s[100]; struct symtab { char name[10]; int add; } sym[100]; void show(char* a,char* b,char* c) { printf("%8s %5s %6s \n",a,b,c); } void check(char s[]) { if(!strcmpi(s,"START")) { start=1; show("","START","1"); return; } if(!strcmpi(s,"END")) { show("","END","1"); return; } if(!strcmpi(s,"EQU")) […]

4 Comments

C program for Macro Processor

C program for Macro Processor #include<stdio.h> #include<conio.h> #define getx1y1 printf("Enter the order of Ist Matrix:"); scanf("%d%d",&x1,&y1);   #define getx2y2 printf("Enter the order of IIst Matrix:"); scanf("%d%d",&x2,&y2);   #define inputa printf("Enter the value of a:"); for(i=0;i<x1;i++) for(j=0;j<y1;j++) scanf("%d",&a[i][j]);   #define inputb printf("Enter the value of b:"); for(i=0;i<x2;i++) for(j=0;j<y2;j++) scanf("%d",&b[i][j]);   #define addab for(i=0;i<x1;i++) { for(j=0;j<y1;j++) { […]

17 Comments

C progrma for First Come First Serve Algorithm

C progrma for First Come First Serve Algorithm #include<stdio.h> #include<math.h> #include<conio.h> void main() { clrscr(); int p[20],b[20],w[20],t[20],i,v,n,at; int wt=0; float tw,tr; printf("Enter the number of process : "); scanf("%d",&n); printf("enter CPU burst time : "); for(i=1;i<=n;i++) { scanf("%d",&b[i]); t[1]=b[1]; w[1]=0; at=t[1]; wt=w[1]; for(i=2;i<=n;i++) { t[i]=b[i]+t[i-1]; at=at+t[i]; w[i]=t[i-1]; wt=wt+w[i]; } } printf("process \t burst_time \t wait_time […]

18 Comments

C++ program to implement three classes using multiple inheritance

MULTIPLE INHERITANCES AIM: Write a program to illustrating how all the three classes are implemented in multiple inheritance mode ALGORITHM • Start the process • Invoke the class M • Invoke the another class N • Invoke one more class,ie class P,which is inherited by both M and N • Create an object for class […]

15 Comments

C++ program to illustrate Multilevel Inheritance

MULTILEVEL INHERITANCE AIM: A program to illustrate multilevel inheritance. we have three classes, student, test and result. Here class student is the base class. And the class test is derived from the base class student. And the another class result is derived from the class test. ALGORITHM: • Start the process • Invoke the base […]

52 Comments

C++ program to illustrate a Single Inheritance

SINGLE INHERITANCE AIM: A program to illustrate a single inheritance. We have a base class B and a derived class D. The class B contains one private data member, one public data member and three public member functions. The class D contains one private data member and two public member functions ALGORITHAM: • Start the […]

No Comments

C++ program that uses non-recursive functions to traverse a binary tree in In-order

/* Write C++ program that uses non-recursive functions to traverse a binary tree in In-order */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; class node { public: class node *left; class node *right; int data; };   class tree: public node { public: int stk[50],top; node *root; tree() { root=NULL; top=0; } void insert(int ch) { […]

7 Comments

C graphics program for analog clock

Time_Dig[0]=hour/10+48;
Time_Dig[1]=hour%10+48;
Time_Dig[2]=’:’;
Time_Dig[3]=min/10+48;
Time_Dig[4]=min%10+48;
Time_Dig[5]=’:’;
Time_Dig[6]=sec/10+48;