From 920e03203839bfd080eaa2043539e0025cbe611a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 11 Dec 2018 21:56:47 +0100 Subject: [PATCH] c/declarations,loops --- in/public/code/c/index.rst | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/in/public/code/c/index.rst b/in/public/code/c/index.rst index 9ada5f1..de4c1a7 100644 --- a/in/public/code/c/index.rst +++ b/in/public/code/c/index.rst @@ -13,14 +13,21 @@ Main system("pause"); } +Declarations +------------ + +.. code:: c + + char operator; + int entry1 = 0; + int entry2 = 0; + long entry = 0; + Input ----- .. code:: c - int entry1 = 0; - char operator; - int entry2 = 0; printf("type in 2 integers\n"); scanf("%d%s%d", &entry1, &operator, &entry2); printf("sum: %d\n", entry1 + entry2); @@ -45,3 +52,12 @@ Conditions default: printf("Nope!\n"); } + +Loops +----- + +.. code:: c + + while (condition) { + expression1; + }