+ 1

Can any one help me to slolve my problem?

Can anyone help me to solved my problem . The output like this , if i input qqwndjjdbdnd the result willl q=2 , w=1 , n=2 , d=3 , j=2 , b=1 after that sort the value of the abjad from the biggest to the smallest and the final result will like this d=3,q=2,j=2,n=2,b=1,w=1

4th May 2017, 12:50 AM
Maksi Eeq
Maksi Eeq - avatar
14 odpowiedzi
+ 7
Please, explain your problem better.
4th May 2017, 12:59 AM
Ulisses Cruz
Ulisses Cruz - avatar
+ 3
create a structure containing both data type variables as it's members. say struct data { int x; char c; }; Then create an array of the above struct data arr [10]; Now, sort through the array as required.
4th May 2017, 2:41 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 2
You can use pointer but it should work without pointer also.
4th May 2017, 5:19 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 2
Please go through the code. https://code.sololearn.com/cPRA9pRpMWoZ/?ref=app Suggest if it worked for you.
4th May 2017, 5:52 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
4th May 2017, 7:56 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 1
@Maski I am on it.
4th May 2017, 7:02 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
0
You can place the letter and the count in a two dimensional array and then sort on the count element cell.
4th May 2017, 1:56 AM
Ed H.
Ed H. - avatar
0
there is 2 different data type on this case how can i use two dimensional of array?
4th May 2017, 2:24 AM
Maksi Eeq
Maksi Eeq - avatar
0
int for the count , and char for the character
4th May 2017, 2:24 AM
Maksi Eeq
Maksi Eeq - avatar
0
so i must use pointer ? @devender Mahajan
4th May 2017, 5:16 AM
Maksi Eeq
Maksi Eeq - avatar
0
how can it work without pointer @devender Mahajan , can you help me?
4th May 2017, 5:21 AM
Maksi Eeq
Maksi Eeq - avatar
0
yeh like that , but i mean the count is sorted from the higest to lowest , the alphabet its oke if not sorted @devender mahajan
4th May 2017, 6:32 AM
Maksi Eeq
Maksi Eeq - avatar
0
thanks @devender mahajan you are very helpfull
4th May 2017, 8:51 AM
Maksi Eeq
Maksi Eeq - avatar