summaryrefslogtreecommitdiff
path: root/src/Q1/README.md
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-06-02 20:41:36 -0600
committermo <mo.khan@gmail.com>2019-06-02 20:41:36 -0600
commitdb33434da3603a3cefae2d9efbdd1ae82e296520 (patch)
treefa9c6ae526337fa218a12ed40a81dd7f6312a1db /src/Q1/README.md
parenta4752cd7612d1c3bc6a4fabfc66bf7c13353c425 (diff)
reverse words
Diffstat (limited to 'src/Q1/README.md')
-rw-r--r--src/Q1/README.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Q1/README.md b/src/Q1/README.md
index 9a6e32f..2df4062 100644
--- a/src/Q1/README.md
+++ b/src/Q1/README.md
@@ -7,13 +7,15 @@ Student ID: 3431709
Read three sentences from the console application. Each sentence should not exceed 80 characters.
Then, copy each character in each input sentence in a [3 x 80] character array.
-The first sentence should be loaded into the first row in the reverse order of characters – for example,
+
+* The first sentence should be loaded into the first row in the reverse order of characters – for example,
"mary had a little lamb" should be loaded into the array as "bmal elttil a dah yram".
-The second sentence should be loaded into the second row in the reverse order of words – for example, "mary had a little lamb" should be loaded into the array as "lamb little a had mary".
-The third sentence should be loaded into the third row where if the index of the array is divisible by 5,
+* The second sentence should be loaded into the second row in the reverse order of words – for example, "mary had a little lamb" should be loaded into the array as "lamb little a had mary".
+* The third sentence should be loaded into the third row where if the index of the array is divisible by 5,
then the corresponding character is replaced by the letter ‘z’ – for example,
"mary had a little lamb" should be loaded into the array as "mary zad azlittze lazb" – that is,
characters in index positions 5, 10, 15, and 20 were replaced by ‘z’.
+
Note that an empty space is also a character, and that the index starts from position 0.
Now print the contents of the character array on the console.