#include<stdio.h>
void main()
{
int n, pSum = 0, nSum = 0, num;
printf("Enter how many numbers you want print");
scanf("%d",&n);
for(; n>0; n--)
{
printf("Enter a number: ");
scanf("%d",&num);
if(num > 0)
pSum += num;
else
nSum += num;
}
printf("Sum of\n +ve number = %d\n-ve number = %d",pSum,nSum);
}
1 comments: (+add yours?)
thanks man...
Post a Comment