From 10055baaa97fb374991d102a85da2ac6d191c67f Mon Sep 17 00:00:00 2001 From: yeshwanthd <56600297+yeshwanthd@users.noreply.github.com> Date: Mon, 31 Oct 2022 19:25:30 +0530 Subject: [PATCH] Update euler1.c --- euler1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/euler1.c b/euler1.c index 56a949f..75cbcbf 100644 --- a/euler1.c +++ b/euler1.c @@ -1,4 +1,5 @@ #include +#include static unsigned long total; @@ -13,13 +14,13 @@ int main(void) for(unsigned int j = 1; j < 1000; j++){ if(j%5==0 && j%3!=0){ - total = total + j; + total += j; //total }else{ - total = total + 0; + total = total; } } - printf("Project Euler problem 1 solution = "); + printf("Project Euler problem 1 solution is "); printf("%lu \n", total); return 0;