From 3cc0e50b147350ba582f6ef0ad80099b5239fdff Mon Sep 17 00:00:00 2001 From: vabhv Date: Tue, 30 Oct 2018 18:15:27 +0530 Subject: [PATCH] Add C concept question by Vaibhav Shrivastava to hackSocIndore's hacktoberfest18 repo --- C/tricky.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 C/tricky.c diff --git a/C/tricky.c b/C/tricky.c new file mode 100644 index 0000000..4d5315d --- /dev/null +++ b/C/tricky.c @@ -0,0 +1,13 @@ +#include +main() { +char ch = 'y'; +while (ch == 'y') { + printf("Type \'n\' to exit or something else to keep running\n"); + scanf("%c",&ch); + if (ch=='n') { + printf("bye\n"); + break; + } + printf("Do you know why the program exited even when you didn't press n? ;)\n"); + } +}