Advertisement
aiNayan

4(iv)

Nov 6th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5. int n, i, count = 0;
  6. printf("Enter the number: ");
  7. scanf("%d", &n);
  8. for (i = 1; i <= n; i++)
  9. count += i;
  10. printf("Sum of %dth is %d", n, count);
  11. return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement