tan x Graph

Description:           This program creates a graph for tan x.   Primary Inputs:    —— Primary Output:    tan x Graph Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include void main() { int gd=DETECT,gm; int x,y; initgraph(&gd,&gm,"c:\\tc\\bgi"); for(x=0;x

Sine Curve

Description:           This program creates a sine curve   Primary Inputs:    —– Primary Output:    A sine curve for prespecifed parameters. Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*This program generates the sine curve for prespecified parameters. */ #include #include #include #include #include void main() { int gdriver=DETECT,gmode,i; float x=0; clrscr(); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); for(i=0;i

Rolling Circle

Description:           This program creates a graphic in which one circle (small) is rolling on the surface of other circle(large).   Primary Inputs:    —– Primary Output:    small circle rolling on the circumference of large circle Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include #include #include #define ROUND(a) (int)(a+0.5) void main() { int i,ang; ...

Fan

Description:           This program creates a graphic for fan motion.   Primary Inputs:    —– Primary Output:    fan in motion Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include #include void main() { int gdriver=DETECT; int gmode; float x,y,u,g,h,x1,y1,x2,y2,r,r1,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8,x9,y9; initgraph(&gdriver, &gmode,"c:\\tc\\bgi"); x=getmaxx()/2; y=getmaxy()/2; r=20; r1=200; for(h=0;h

Car

Description:           This program creates graphic for moving car. Primary Inputs:    ——- Primary Output:    moving car Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include void main() { int gdriver = DETECT; int gmode; int i; initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); line(0,400,640,400); for(i=0;i

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 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