//program to arrange the string in decending order
#include
#include
#include
#include
class des {
private:char ch[35],temp;
int len;
public: int get();
int sort(int);
int print(int);
};
int des::get()
{
cout<<"neter the st: ";
gets(ch);
len=strlen(ch);
return len;
}
int des::sort(int i)
{
for(int j=0;j
{ for(int k=j+1;k
{
if(ch[j]
{ temp=ch[j];
ch[j]=ch[k];
ch[k]=temp;
}
}
}
return i;
}
int des::print(int p)
{
for(int m=0;m
{ cout<
return 0;
}
void main()
{ clrscr();
des hi;
int a=0,b=0,c=0;
a=hi.get();
b=hi.sort(a);
hi.print(b);
getch();
}
2007-02-23
23:11:34
·
2 answers
·
asked by
simran m
1
in
Computers & Internet
➔ Programming & Design