#include<iostream.h>
#include<conio.h>
class sample
{
int t,i,j;
public:
void sort(int a[],int);
void sort(float b[],int);
};
void sample::sort(int a[],int n)
{
for(i=0;i
for(j=0;j
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
cout<<"\n Sorted integer array : ";
for(i=0;i
{
cout<<" "<
}
}
void sample::sort(float a[],int n)
{
for(i=0;i
{
for(j=0;j
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
cout<<"\n Sorted float array : ";
for(i=0;i
{
cout<<" "<
}
}
void main()
{
int a[20],n,c,i;
float b[20];
sample s;
clrscr();
cout<<"\n Enter Size of integer array : ";
cin>>n;
cout<<"\n Enter "<
for(i=0;i
{
cin>>a[i];
}
cout<<"\n Enter size of Float array : ";
cin>>c;
cout<<"\n Enter "<
for(i=0;i
{
cin>>b[i];
}
s.sort(a,n);
s.sort(b,c);
getch();
}
/* OUTPUT
Enter Size of integer array : 5
Enter 5 Elements : 3 2 4 1 5
Enter size of Float array : 5
Enter 5 Elements : 1.1 2 3 4.4 5
Sorted integer array : 1 2 3 4 5
Sorted float array : 1.1 2 3 4.4 5 */