Skip to the task
Layout
Back to classic view

You are looking ahead. Your place is still task 1: Algorithm.

EDITTask 10 of 21 · step 5: Special charactersAdd a table, a path and a percentage
Add a table, a path and a percentage in practice/01/

Before return 0; add six printf lines: an empty line, a table with \t and \", a path with \\ and a percentage with %%.

Checklist

  • Every task is one commit with a clear message.

Numbered notes in the code explain the important lines.

Details & hint
You write You get
\n a new line
\t a tab: a jump to the next column, every 8 characters
\" a quote "
\\ one \
%% one % (only in a printf string)

\ starts an escape sequence: together with the next character it means one character. % starts a printf format (in topic 2, %d puts a number there), so a real % needs two.

practice 01 main.c Code Diff +6
M · MODIFIED git diff: red = old code, green = new.
--- a/practice/01/main.c
+++ b/practice/01/main.c
@@ -8,5 +8,11 @@
printf("2. Count how many grades there are.\n");
printf("3. Divide the sum by the count.\n");
printf("4. Print the answer.\n");
+ printf("\n");
+ printf("Grade\tMeaning\n");
+ printf("10\t\"excellent\"\n");
+ printf("5\t\"satisfactory\"\n");
+ printf("File: C:\\course\\practice\\01\\main.c\n");
+ printf("Done: 100%%\n");
return 0;
}