Description
LAB9 Quiz
Assoc. Prof. Dr. Hacer Yalım Keleş
DuraSon: 120 minutes
• Print the names in descending order, i.e. the reverse of the dic9onary order.
• The names can contain small or capital leEers; you need to represent all the characters in a name in small leEers first (before sor9ng). i.e. john marie jack etc.
Input format: [S] stands for a Space character
<N: number of names>[‘ ’]
<Name 1>[S]<Name 2>[S] … <Name N>
Output Forma_: Name_A<i> below shows the i’th name in the descending ordered name set.
< Name A1>’ ’
< Name A2>’ ’
…
< Name AN>’ ’
Example Input:
3
boB aNNie John
Output:
john bob annie
Hints:
You can include <string.h> file and use related string func9ons if you need them.
TesSng:
No test files will be provided for this quiz. Test your programs with your own test files while developing your program.
As usual, use input redirec3on mechanism of your opera9ng system to test your programs. For example, if your executable is called as Lab9, redirect the input.txt file to standard input using < operator and redirect your outputs to a file using > operator such as:
> ./Lab9<input.txt>output.txt
This kind of execu9on enables your programs to read inputs from a file without wri9ng any file related func9ons (e.g. fopen(), fscanf() etc.). In other words, the getchar() or scanf() func9ons in your code reads data from the redirected files instead of the std. input in this way (e.g. keyboard).
Submission:
Before submission, make sure that your source file is named as StudentNumber.c
Good luck ☺
Reviews
There are no reviews yet.