Graph Simulator

How to use make file (linux)   $cd <your directory containing the makefile and other prg files> $make -f <filename>.make $./<filename>.out

Stack Implementation

Description:           This program is Menu driven program to implement Stack.   Primary Inputs:    the numbers to be pushed on to the stack Primary Output:    Stack Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to implement stack */ #include #include #include #define MAX 10 /*size of the Stack*/ struct stack { int arr[MAX]; }s; int TOP=-1; ...

Sorting and Merging

Description:           This program first sort the two given arrays and then merge them in ascending order.   Primary Inputs:    Two arrays of size 5 Primary Output:    Single array containing the elements of both the given arrays arranged in ascending order Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to sort and merge two given arrays*/ ...

Recursive Matrix Multiplication

Description:           This program performs the multiplication of two 4×4 matrices using recursion.   Primary Inputs:    Two 4×4 matrices Primary Output:    Multiplication of the two matrices Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*This program calculates the multiplication of two 4x4 matrices using recursion*/ #include #include int a[4][4],b[4][4],c[4][4]; int multi(int,int,int); void main() { int i,x; clrscr(); ...

Infix to Postfix 1

Description:              This program performs the conversion of infix expression into postfix expression.   Primary Inputs:        infix expression (with or without parentheses) Primary Output:       corresponding postfix expression Platform Used:          Turbo C++ version 3.0, Borland International Inc.   /*program performs the infix to postfix conversion*/ #include #include #define max 30 /*prototype declaration of a fuction*/ void pre(char x); ...

Matrix Transpose

Description:           This program performs the transpose of a given Matrix.   Primary Inputs:    row no.,column no, element’s value Primary Output:    transpose of a given matrix Platform Used:      Turbo C++ version 3.0, Borland International Inc.   Code for transposing a matrix C /*program to find the transpose of a given matrix*/ #include<stdio.h> #include<conio.h> #define max 10. void main() ...

Matrix Multiplication

Description:           This program performs the multiplication of two Square Matrices.   Primary Inputs:    Two Square Matrices(3X3 only) Primary Output:    Product of two square matrices Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to find product of two matrices (3X3)*/ #include #include void main() { int a[3][3],b[3][3],c[3][3],i,j,k; clrscr(); printf("enter the first matrix\n"); for(i=0;i

Linked List

Description:           This program is Menu driven program for Creating/deleting items in the Linked List.   Primary Inputs:    number to be stored in the Linked List and its location Primary Output:    Linked List Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to implement Linked List*/ #include #include #include struct node { int data; struct node ...

Fibonacci

Description:           This program will generate the Fibonacci Sequence   Primary Inputs:    —– Primary Output:    Fibonacci Sequence Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to generate Fibonacci Sequence*/ #include #include #define MAX 10 void main() { int j,temp; int a=0,b=1,i=1; int fib[MAX]; clrscr(); fib[0]=0; fib[1]=1; while(i

Factorial

Description:           This program find the factorial of a given number.   Primary Inputs:    Number Primary Output:    Factorial of the given number Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*program to find factorial of a number*/ #include #include /*prototype declaration of a function*/ unsigned long int fact(int); void main() { int x; char another='y'; unsigned ...