programs

C++ programs for sorting numbers in ascending order using Quick sort method

C++ programs for sorting numbers in ascending order using Quick sort method

/* Write C++ programs for sorting a given list of elements in ascending order using Quick sort sorting methods */ #include<iostream.h> #include<conio.h> int a[10],l,u,i,j; void quick(int *,int,int); void main() { clrscr(); cout <<"enter 10 elements"; for(i=0;i<10;i++) cin >> a[i]; l=0; u=9; quick(a,l,u); cout <<"sorted elements"; for(i=0;i<10;i++) cout << a[i] << " "; getch(); }   […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

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

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) { […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

C Program to for Midpoint Line algorithm

C Program to for Midpoint Line algorithm

Program to implement the Midpoint Line algorithm to generate a line of given slope and thickness. Implement the polyline (many lines) command using this algorithm as a routine that display a set of straight lines between N input points. For n=1 the routine displays a single point.

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

C program to for Moving Car

C program to for Moving Car

line(80+i,300,90+i,270);
line(90+i,270,120+i,270);
line(120+i,270,160+i,240);
line(160+i,240,230+i,240);
line(230+i,240,275+i,270);

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

C program to implement Spiral Model

C program to implement Spiral Model

setcolor(YELLOW);
printf(“ENTER THE NUMBER OF RINGS IN THE SPIRAL MODEL\n”);
scanf(“%d”,&n);
printf(“Enter the origin point of the spiral”);
scanf(“%d%d”,&x,&y);

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

C program to implement Bar Graph

C program to implement Bar Graph

setcolor(CYAN);
printf(“ENTER THE NUMBER OF DATA ELEMENTS\n”);
scanf(“%d”,&n);

line(1,1,1,479);// Y axis
line(1,479,640,479);// X axis

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone