0
How to right the c program.? Using the arrange()
Output 3latter word xyz
11 Antworten
+ 1
So you need to arrange the letters in descending order by writing your own arrange() function?
+ 1
Lets start with getting the users input.
How will you get the user input and store it in the array?
Lets say
char three_letters[4];
+ 1
In your terminal window type "man scanf" or "man fgets" and show me how you will store the user input into
char three_letters[4];
+ 1
so:
char three_letters[4];
puts("Please enter three letters:");
scanf( What goes in here );
+ 1
The problem with scanf is that its not going to protect from segment fault. I would use fgets for this project.
char three_letters[4];
puts("Please enter three letters:");
fgets( What goes in here? );
+ 1
Yes bro i try nw. Thks
+ 1
After you get the users input you will have to build your arrange() function
this can be done in a few ways:
void arrange(char *word){ Do Stuff; }
or
char *arrange(const char *word){ Do Stuff;}
Show me some of your work, and well keep building this together.
0
Write a program to ask the user to enter three(3) letter. Store the data in char arry a[]. Use arrange to sort the letter in descending order,then print the result to the terminal screen. Example enter 3 letter: xyz. Zyx
0
Printf
0
Scanf
- 1
This is my exam Question. How to do don't know? Pls help us thanks.