# ascending and descending orders of letters

Page 1 of 1

## 7 Replies - 17734 Views - Last Post: 27 January 2010 - 02:36 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=94729&amp;s=ec5502d8531e0b2fa3af73d575f84de4&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Perpendikulo

Reputation: 0
• Posts: 9
• Joined: 16-March 09

# ascending and descending orders of letters

Posted 22 March 2009 - 11:43 PM

```#include<iostream.h>
#include<stdlib.h>
void main()
{

char *letters[26]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","X","Y","Z"};

int x,y,z;
char choice,word;

cout<<"This program will form your the letters of the\n";  //problem
cout<<"words` in ASCENDING and DESCENDING form.\n";
cout<<endl;

cout<<"OPTION:";								//option
cout<<endl;
cout<<"A.Ascending\n";
cout<<"B.Descending\n";
cout<<endl;

cin>>choice;

system("pause");
system("cls");

if(choice == 'a' || choice == 'A')				//ascending
{
cout<<"Enter word : ";
cin>>word;
cout<<"sorted word(ascending):";

for(x=0;x<=26;x++)
{
if(word == *letters[26])
{
cout<<letters[x];

}
}

}

}

```

Is This A Good Question/Topic? 0

## Replies To: ascending and descending orders of letters

• Saucy!

Reputation: 6219
• Posts: 23,965
• Joined: 23-August 08

## Re: ascending and descending orders of letters

Posted 23 March 2009 - 04:51 AM

Please restate your question, and the problems you may be having, in the body of your message.

### #3 Perpendikulo

Reputation: 0
• Posts: 9
• Joined: 16-March 09

## Re: ascending and descending orders of letters

Posted 23 March 2009 - 11:52 PM

[quote]
ok!!
[/quote

### #4 smith2009

Reputation: 0
• Posts: 6
• Joined: 20-March 09

## Re: ascending and descending orders of letters

Posted 24 March 2009 - 02:53 AM

Hi,

That's good Program.

Can you write another program from which we can entering a String and convert it in to lower case or upper case ?
I need that

_____________________________
Smith
Beginner in ColdFusion Development.

### #5 VenumX

Reputation: 0
• Posts: 8
• Joined: 21-February 09

## Re: ascending and descending orders of letters

Posted 24 March 2009 - 07:36 AM

you may want to look into getting the dec value of the character in the array and using it in a bubble sort algorithm. if you're not familiar with bubble sort its basically an algorithm that will switch around the items in the array until no swaps are needed. im sure you could find example code either on this site by searching or on google.

### #6 mischief6

Reputation: 1
• Posts: 21
• Joined: 09-January 09

## Re: ascending and descending orders of letters

Posted 24 March 2009 - 08:06 AM

you could do this pretty easily with the sort function in the algorithm header.

### #7 slones

Reputation: 0
• Posts: 1
• Joined: 27-January 10

## Re: ascending and descending orders of letters

Posted 27 January 2010 - 02:22 AM

Perpendikulo, on 22 Mar, 2009 - 10:43 PM, said:

```#include<iostream.h>
#include<stdlib.h>
void main()
{

char *letters[26]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","X","Y","Z"};

int x,y,z;
char choice,word;

cout<<"This program will form your the letters of the\n";  //problem
cout<<"words` in ASCENDING and DESCENDING form.\n";
cout<<endl;

cout<<"OPTION:";								//option
cout<<endl;
cout<<"A.Ascending\n";
cout<<"B.Descending\n";
cout<<endl;

cin>>choice;

system("pause");
system("cls");

if(choice == 'a' || choice == 'A')				//ascending
{
cout<<"Enter word : ";
cin>>word;
cout<<"sorted word(ascending):";

for(x=0;x<=26;x++)
{
if(word == *letters[26])
{
cout<<letters[x];

}
}

}

}

```

### #8 suresh.chereddy@gmail.com

Reputation: 1
• Posts: 57
• Joined: 06-February 08

## Re: ascending and descending orders of letters

Posted 27 January 2010 - 02:36 AM

you were not specifying the function definition...please check it out