From: Cian Bagshaw Date: Fri, 25 Nov 2022 03:31:18 +0000 (+0000) Subject: Addex exercise 1-2 X-Git-Url: https://tests.cianb.xyz/?a=commitdiff_plain;h=3ea8d4075cc1faa42d63429853643c276347cfed;p=cProgLang Addex exercise 1-2 --- diff --git a/1/2.c b/1/2.c new file mode 100644 index 0000000..c6aa94e --- /dev/null +++ b/1/2.c @@ -0,0 +1,41 @@ +/* + Exercise 1-2. Experiment to find out what happens when printf's argument string + contains \c, where c is some character not listed above. + === + + When run together, no output is given. GCC gives many warnings, mostly stating + that the escape sequence is unknown. When I compile with only sequences that do + not draw warnings, I mostly get nothing. I believe further characters are + required in most sequences to make them meaningful. +*/ + +#include + +int main () { + printf("a: \a\n"); + printf("b: \b\n"); + printf("c: \c\n"); + printf("d: \d\n"); + printf("e: \e\n"); + printf("f: \f\n"); + printf("g: \g\n"); + printf("h: \h\n"); + printf("i: \i\n"); + printf("j: \j\n"); + printf("k: \k\n"); + printf("l: \l\n"); + printf("m: \m\n"); + printf("n: \n\n"); + printf("o: \o\n"); + printf("p: \p\n"); + printf("q: \q\n"); + printf("r: \r\n"); + printf("s: \s\n"); + printf("t: \t\n"); + printf("u: \u\n"); + printf("v: \v\n"); + printf("w: \w\n"); + printf("x: \x\n"); + printf("y: \y\n"); + printf("z: \z\n"); +}