Compare the letters | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Compare the letters

I have to write a program which takes a word which has 4 letters, then give us its letters by alphabet arrangement for example: Laya~>aaly I don’t know how i can compare the letters

6th Nov 2019, 8:56 PM
Laya Mousavi
7 Answers
+ 1
Laya Mousavi Do you need to convert the input to lowercase before comparing and sorting the characters in the input string? I see you wrote "Laya" -> "aaly"
7th Nov 2019, 7:08 AM
Ipang
+ 1
Laya Mousavi Check this documentation for ctype.h header. The header provides functions you can use to verify whether a character was alphabetical, numeric etc. Also how to tell whether the character was a lowercase or uppercase, and to convert between upper to lowercase, vice versa. http://www.cplusplus.com/reference/cctype/ To sort the string (after converting it to lowercase), you can utilise `qsort` function, provided in stdlib.h header. You can learn how to use the function from the following reference: https://en.cppreference.com/w/c/algorithm/qsort Good luck! 👍
7th Nov 2019, 8:43 AM
Ipang
+ 1
Ipang thank u so much🙋🏻‍♀️🙋🏻‍♀️
7th Nov 2019, 2:05 PM
Laya Mousavi
+ 1
You're welcome Laya Mousavi 😁 So, you will post the code here when you're done or what? cause I'd like to see it.
7th Nov 2019, 2:27 PM
Ipang
+ 1
You're welcome Laya Mousavi 😁 So, you will post the code here when you're done or what? cause I'd like to see it.
7th Nov 2019, 2:27 PM
Ipang
0
greedy fox they work but we didn’t stady these we have stadied <stdio.h> <math.h> i have to mail my exercises in these format , to our teacher i don’t know how i can write this program
7th Nov 2019, 8:05 AM
Laya Mousavi
0
Ipang actually i don’t know how i can compare the letters how i can convert the input to lowercase?!
7th Nov 2019, 8:08 AM
Laya Mousavi