This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

20 lines
431 B
C

#include <stdio.h>
int main()
{
int num;
int total = 0;
printf("Enter a number between 10 and 200:\n");
scanf("%d", &num);
if (num >= 10 && num <= 200)
{
for (int i = 1; i <= num; i++)
{
total += i;
}
printf("The sum of the numbers 0 to %d is %d.", num, total);
}
else
{
printf("The number you entered is not within the given range.");
}
}