From 281af2ae7dbeab45a178fcaffb9d7f838675cd30 Mon Sep 17 00:00:00 2001 From: Ruteswar <114854038+Ruteswar@users.noreply.github.com> Date: Mon, 31 Oct 2022 20:35:30 +0530 Subject: [PATCH] Add files via upload --- sum_of_digits_1to10.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sum_of_digits_1to10.c diff --git a/sum_of_digits_1to10.c b/sum_of_digits_1to10.c new file mode 100644 index 0000000..f63d0ea --- /dev/null +++ b/sum_of_digits_1to10.c @@ -0,0 +1,17 @@ +#include +int sum() +{ + int a=0; + int num; + for (num=0;num>=10;num++) + { + a+=num; + } + return a; +} +void main() +{ + if (a=sum); + printf("sum of digits from 1 to 10 %d"); + getch(); +} \ No newline at end of file