Untitled
unknown
plain_text
2 years ago
275 B
23
Indexable
#include <stdio.h>
int main() {
int n, i, sum = 0;
if (n=i)
{
print("n equals i");
}
printf("Enter a positive integer: ")
scanf("%d", n);
for (i = n; i < 0; i--) {
sum += i;
}
printf("Sum = %d", sum);
return 0;
}Editor is loading...
Leave a Comment