Advertisement
mujahidul_islam

6

Jun 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include<stdio.h>
  2. int main ()
  3.  
  4. {
  5.     int i,n,sum=0;
  6.  
  7.     scanf("%d", &n );
  8.  
  9.     for(i=1;i<=n;i++){
  10.  
  11.         sum = sum + i;
  12.     }
  13.     printf("%d",sum);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement