Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main()
- {
- long long n,i,sum=0;
- printf("how many numbers?");
- scanf("%d",&n);
- long long a[n];
- for(i=0;i<n;i++)
- {
- printf("x=");
- scanf("%d",&a[i]);
- sum=sum+a[i];
- }
- if(sum<0)
- sum=sum*-1;
- printf("%d\n\n",sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement