From 3de7a0d1c225a75d21eee5021303bd3642c6669c Mon Sep 17 00:00:00 2001 From: WongChinWee <93850449+WongChinWee@users.noreply.github.com> Date: Sun, 8 May 2022 22:44:15 +0800 Subject: [PATCH] Update exercise1.c --- exercise1.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/exercise1.c b/exercise1.c index ba9f281..b53e2ee 100644 --- a/exercise1.c +++ b/exercise1.c @@ -7,13 +7,30 @@ //global variable section -//main function section -int main(){ - //write here your program +//main function section +int main() +{ + int a = 1; + int b = 2; + int c = 3; + int d = 4; + int e = 5; + int f = 6; + int g = 7; + int h = 8; + int i = 9; + int j = 10; + + int sum; + + sum = a + b + c + d + e + f + g + h + i + j; + + printf("The sum of numbers from 1 to 10 is %d \n", sum); return 0; + } +//user-defined section -//user-defined section \ No newline at end of file