I'm trying to write a small program to loop through a list of words and find the numeric order of the letters in the string, e.g. HELLO will return 21345 (I don't want to double up numbers) and PROSPER will be 3527416. I'm having trouble thinking of a way I can do this. Any ideas? I imagine I'll have to use the ord() function, but that's about as far as I've gotten.

Member Avatar
Member Avatar
+0 forum 5

Hi guys can you please help me with this. All I need to do is input a number and display the corresponding alphabet.For example 2 then the output should be A B.. I am working on a code but my problem is the output is displaying together with a special character. Can you help me do it pls. Thanks in advance! #include<stdio.h> #include<stdlib.h> #include<conio.h> int main() { int num; char *buffer; printf("How long is the string:"); scanf("%s",&num); buffer=(char *) malloc(num); if (buffer==NULL) exit(1); for(int i=0;i<num;i++) { for (int j=0;j<i;j++) buffer[j]=(i%26)+'A'; printf("The strings are: %s \n",buffer); getch(); free(buffer); } return 0; …

Member Avatar
Member Avatar
+0 forum 2

How do I sort a list in Python alphabetically? The code that is used for Python 2 doesn't seem to work: [CODE=python] mylist.sort() [/CODE] Since the file I'm working with has all text in the same case, case doesn't matter here. Please help. Thanks.

Member Avatar
Member Avatar
+0 forum 2

I need to do a program that the user will input a letter from alphabet then the program will show the alphabet that starts with the inputted letter. for example Letter: B B C D E F G and so on.. please help me guys.. ive been doing this almost 2 days.. i really dont know what to use from array.. huhuh. please guys? godbless!

Member Avatar
Member Avatar
+0 forum 6

I'm working on a program that will get a list of words from the user and rearrange it in alphabetical order. So far it works but I think it may have some memory issues because I was testing an alternative way of asking the user how many arrays will be needed other than dynamic memory. Here is the code: [CODE]#include<string> using namespace std; int main() { int n; //Used to set the number of arrays of MiString and MiNewString. cout << "How many words do you want the list to contain? "; cin >> n; string MiString[n], MiNewString[n], Temp; //This …

Member Avatar
Member Avatar
+0 forum 7

Past paper question from 2007: Source University of Cape Town - CSC2001F - 2007 Which of the two statements shown below will provide an lexicographical (alphabetic) string comparsion? why? [code=C++] char *mesg1 = "Hello", *mesg2 = "world"; string s1 = "Hello", s2 = "world"; if (s1 != s2) {...} // statement 1 if (mesg1 != mesg2 ) {...} // statement 2 [/code] I thought both of these would provide alphabetic string comparison... But I guess I'm wrong.. What would be the correct answer

Member Avatar
Member Avatar
+0 forum 4

I need the coding for the following question in C: Read and print all the consonants from a file (no duplicates). Assume the file is a .txt file. The consonants are then to be sorted in alphabetical order.

Member Avatar
Member Avatar
-6 forum 2

Hi all. Bit of a problem - hope somebody can help. I am trying to return lists sorted alphabetically in my native language - Welsh. The alphabet: a,b,c,ch,d,dd,e,f,ff,g,ng,h,i,j,l,ll,m,n,o,p,ph,r,rh,s,t,th,u,w,y (29 letters) Note that there are 'double characters' - these are considered as single discrete letters. Roman letters (k,q,v,x,z) can be added to produce this 'composite alphabet': a,b,c,ch,d,dd,e,f,ff,g,ng,h,i,j,k,l,ll,m,n,o,p,ph,q,r,rh,s,t,th,u,v,w,x,y,z (34 letters) In addition vowels (a,e,i,o,u,w,y) can be accented with grave, acute, umlaut and circumflex - these should be equivalent to the unaccented letters - i.e. â, à etc equivalent to 'a'. This means that search results should be sorted as follows: agor a[B]ng[/B]el …

Member Avatar
Member Avatar
+0 forum 1

The End.