C program | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 1

C program

Can i have some help here please I have set of string elements assume it orange , cucumber,apple,kiwi how can i do c programming that take from user any set of the strings like that and assign every element of this set to index of array in ascending order ( first input by user first be indexed in array ) thanks for advance!

3rd Jun 2020, 12:29 PM
ebrahem hesham
ebrahem hesham - avatar
8 Respostas
+ 2
you can use a pointer to a pointer, pointer to an array or a 2d array then sort it in which ever order you want
3rd Jun 2020, 2:31 PM
‚ú≥AsterisK‚ú≥
‚ú≥AsterisK‚ú≥ - avatar
+ 1
devanille thanks ūüėä i really from my heart appreciate your help thanks again ‚̧ԳŹ‚̧ԳŹ‚̧ԳŹ
4th Jun 2020, 4:13 PM
ebrahem hesham
ebrahem hesham - avatar
+ 1
I have not understood your question properly give a explanation of input and output formate
4th Jun 2020, 6:52 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
ebrahem hesham here is your answer i tried in cpp u can make in c . i hope u expect same output which i made. #include <iostream> using namespace std; int main() { const char *colour[4] = { "Autumn", "Winter", "Summer", "Yellow" }; for(int i=0;i<3;i++) { cout << colour[i] <<"-"<<i<<"\n"; } return 0; }
5th Jun 2020, 11:09 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
ūĚźäūĚźĘūĚźĘūĚźõūĚź® ūĚźÜūĚź°ūĚźöūĚź≤ūĚźöūĚź• how can I do that ? The program i wanna do should solve two things the string that entered should be in punch of chars not only char and the second is to determine index to each element of this set strings
3rd Jun 2020, 1:52 PM
ebrahem hesham
ebrahem hesham - avatar
0
ūĚźäūĚźĘūĚźĘūĚźõūĚź® ūĚźÜūĚź°ūĚźöūĚź≤ūĚźöūĚź• what i attempt to do is when you enter the index of the string you get one of these elements defined in array which will retrieve the string name element belongs to that index like that Enter number to see : 3 Your color is "blue"
3rd Jun 2020, 2:17 PM
ebrahem hesham
ebrahem hesham - avatar
0
C,Cpp,Java,Html. How can I have set of strings ordered by index in an array in c instead of having characters only in indexing Input Spring , Autumn,winter, summer Output : Enter the seoson you need 2 Result The seoson is summer .
4th Jun 2020, 10:13 PM
ebrahem hesham
ebrahem hesham - avatar
0
C,Cpp,Java,Html. Thanks ūüėė
5th Jun 2020, 3:11 PM
ebrahem hesham
ebrahem hesham - avatar