From ddd17355532e83d99b0cfb0b54d5a739a603670f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 11 Dec 2018 21:43:19 +0100 Subject: [PATCH] c/input --- in/public/code/c/index.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/in/public/code/c/index.rst b/in/public/code/c/index.rst index 09ce45e..d0e739f 100644 --- a/in/public/code/c/index.rst +++ b/in/public/code/c/index.rst @@ -12,3 +12,14 @@ Main printf("Hello, world!\n"); system("pause"); } + +Input +----- + +.. code:: c + + int entry1 = 0; + int entry2 = 0; + printf("type in 2 integers\n"); + scanf("%d%d", &entry1, &entry2); + printf("sum: %d\n", entry1 + entry2);