diff options
Diffstat (limited to 'wk1/agree.c')
-rw-r--r-- | wk1/agree.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wk1/agree.c b/wk1/agree.c new file mode 100644 index 0000000..0676cd2 --- /dev/null +++ b/wk1/agree.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include <cs50.h> + +int main(void) +{ + char c = get_char("Do you agree? "); + if (c == 'y' || c == 'Y') + { + printf("Agreed.\n"); + } + else if (c == 'n' || c == 'N') + { + printf("Not agreed.\n"); + } +} |