complete assignment01

This commit is contained in:
SowinskiBraeden committed 2025-09-20 16:19:53 -07:00
1 parent 3b82537781
commit 964dd99acf
5 files changed
+187

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
#include <stdio.h>
int main(void) {
int max;
int min;
int sumOfSquares;
do {
sumOfSquares = 0;
printf("Enter a lower and upper limit: ");
scanf("%d %d", &min, &max);
if (max <= min) {
break;
}
for (int i = min; i <= max; i++) {
sumOfSquares += i * i;
}
printf(
"The sums of the squares from %d to %d is %d\n",
min * min,
max * max,
sumOfSquares
);
} while (max >= min);
printf("Done\n");
return 0;
}