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

Thursday, March 11th, 2010  »  Posted By  »  Total 21 Comments

/* 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(); }   […]

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

Thursday, March 11th, 2010  »  Posted By  »  Total 0 Comment

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

Java program to read and display files

Friday, October 2nd, 2009  »  Posted By  »  Total 1 Comment

Wtire a Java program that reads a file and displays the file on the screen, with a line number before each line.

C Program to for Midpoint Line algorithm

Friday, October 2nd, 2009  »  Posted By  »  Total 4 Comments

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.

C program to for Moving Car

Friday, October 2nd, 2009  »  Posted By  »  Total 19 Comments

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

C program to for Rotation of wheel

Friday, October 2nd, 2009  »  Posted By  »  Total 2 Comments

theta=M_PI*angle/180;
x[i]=xc+r*cos(theta);
y[i]=yc+r*sin(theta);
angle+=20;
line(xc,yc,x[i],y[i]);

C program to implement Spiral Model

Friday, October 2nd, 2009  »  Posted By  »  Total 1 Comment

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

C program to implement Bar Graph

Friday, October 2nd, 2009  »  Posted By  »  Total 1 Comment

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

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: