// Program to sort the nos using radix sort//
#include"iostream.h"
#include"conio.h"
#include"math.h"
#define SIZE 10
#define DIGIT 3
int main()
{
int a[SIZE],n,i,j,p,temp;
clrscr();
cout<<"Enter the no. of terms:";
cin>>n;
cout<<"Enter the terms:\n";
for(i=0;i cin>>a[i];
for(p=1;p<=DIGIT;p++)
for(i=0; i< n-1; i++)
for(j=0;j if((a[j] % (int) pow(10,p))>(a[j+1]%(int) pow(10,p)))
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
cout <<"The sorted array is\n";
for (i=0 ; i < n; i++)
cout << endl << a[i];
getch();
return(0);
}
#include"iostream.h"
#include"conio.h"
#include"math.h"
#define SIZE 10
#define DIGIT 3
int main()
{
int a[SIZE],n,i,j,p,temp;
clrscr();
cout<<"Enter the no. of terms:";
cin>>n;
cout<<"Enter the terms:\n";
for(i=0;i
for(p=1;p<=DIGIT;p++)
for(i=0; i< n-1; i++)
for(j=0;j
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
cout <<"The sorted array is\n";
for (i=0 ; i < n; i++)
cout << endl << a[i];
getch();
return(0);
}