In this video lesson, C program to SORT NAMES in ALPHABETICAL ORDER, we are going to learn how we can arrange given array of string in alphabetical order. To sort names in alphabetical order, we use strcmp() function to compare two strings. strcmp compares two strings character by character and if it found different character, then it calculates the ASCII difference between two characters and accordingly it decides whether the first string is bigger than second or not. For example, the string aBC is bigger than ABC as the ASCII value of a is 97 and the ASCII value of A is 65. So, in this case the string aBC is bigger than ABS. Using this logic we can swap the string and SORT NAMES in ALPHABETICAL ORDER. Note that it stops comparing after strcmp() got difference in characters.
To understand the whole concept, watch the video till end.
If you have any doubt or query regarding this video lesson, please let me know in the comment section below.
So, lets begin! Wish you happy learning!
spartakrish, mysteriokrish
#Krishnalede,#Learncwithperfection
Don't forget to subscribe my channel.
Keywords:
1. sorting string
2. learn C programming
3. arrange names in alphabetical order in c
4. C program to sort string in alphabetical order
5. List the names in order
6. C programming tutorial
7. Basic, programming
8. Sorting 2-D string in alphabetical order
9. C program to arrange string in order
10. Sort the name of string in alphabetical order
11. How can we arrange string in alphabetical order
12. How to sort names in alphabetical order in c
13. Sort names in alphabetical order
14. Krishna lede
15. SORT NAMES in ALPHABETICAL ORDER
Twitter Page: / lede_v
Facebook Page: / krishnavlede