fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n, i, sum = 0;
  6.  
  7. printf("Enter the number: ");
  8. scanf("%d", &n);
  9.  
  10. for(i = 0; i <= n; i++)
  11. {
  12. sum = sum + i;
  13. }
  14.  
  15. printf("%d", sum);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Enter the number: 536788995