Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,sum;
- printf("enter value of n: ");
- scanf("%d",&n);
- sum=(n*(n+1))/2;
- printf("summation is :%d\n",sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement