Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 234 Bytes

Gouravmoonka.md

File metadata and controls

15 lines (13 loc) · 234 Bytes

#include <stdio.h> int main() { int n, i, sum = 0; printf("Enter a positive integer: "); scanf("%d", &n); i = 1;

while (i <= n) {
    sum += i;
    ++i;
}

printf("Sum = %d", sum);
return 0;

}