#include<iostream.h>
#include<conio.h>
class bubbleShort
{
int size, a[100];
public:
void getdata();
void sorting();
};
void bubbleShort :: getdata()
{
int i;
cout << "\nEnter total number of elements: " ;
cin >> size;
cout << "\nEnter elements: ";
for(i=0;i<size;i++)
cin >> a[i];
cout << "\nEntered elements are: ";
for(i=0;i<size;i++)
cout << a[i] << " ";
}
void bubbleShort :: sorting()
{
int i,j,temp;
for(i=1;i<size;i++)
{
for(j=0;j<size-i;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
cout << "\nElements After Shorting:";
for(i=0;i<size;i++)
cout << "\n" << a[i];
}
void main()
{
clrscr();
bubbleShort bsrch;
bsrch.getdata();
bsrch.sorting();
getch();
}
there is some good c ,java, sql and vb6 programs,Windows tricks, sms shorthand etc
Thursday, March 29, 2012
WAP of Bubble Short in C++
/*WAP of Bubble Short in C++*/
Subscribe to:
Post Comments (Atom)
How to earn online
How to earn online:
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786
No comments:
Post a Comment