# All C Programs and Terms

1. Can anybody help me with this problem???

enter 10 nos.
*
*
*
*
*
*
*
*

summary: ***********(ung sampu)
negative nos: (kung ilan un neg)
positive nos:

sum of negative nos:
sum of positive nos:

Any my codes are:

#include
main()
{

int n[10], sum1, sum2,
x, y;

printf("Enter 10 numbers: \n");
{for(x=0;x<=10;x++)
n[x]=0;
}
{for(x=0;x<=10;x++)
sum1+=n[x];
}

scanf("%d", &n);
{
printf("SUMMARY: %d", n);
}

getch();
}

ANY CORRECTIONS????

1. //it would be like this.

#include
#include
#include

void main()
{
int a[10],i,sum=0;

clrscr();

printf("Enter 10 numbers for addition: \n");

for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}

printf("sum=%d",sum);

getch();
}

2. program for addition of numbers and display positive and negative numbers and their addition
#include
#include
void main()
{
int a[10],i,sum=0,neg=0,pos=0;
clrscr();
printf("Enter 10 numbers for addition: \n");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
sum=sum a[i];
}
printf("sum of numbers= %d",sum);
printf("\nPositive nos : ");
for(i=0;i<10;i++ )
{
if(a[i]>0)
{
printf("%d\t",a[i]);
pos=pos a[i];
}
}
printf("\nsum of positive nos=%d",pos);
printf("\nNegative nos: ");
for(i=0;i<10;i ++)
{
if(a[i]<0)
{
printf("%d\t",a[i]);
neg=neg a[i];
}
}
printf("\nsum of Negative nos=%d",neg);
getch();
}