//Average of +ve and -ve numbers until -1000
#include
#include
main()
{
	int a;
	int pos_count=0,neg_count=0;
	int pos_sum=0,neg_sum=0;
	float pos_average,neg_average;
	clrscr();
	printf("Enter the Values\n");
	scanf("%d",&a);
	while (a!=-1000)
	{
		if (a > 0)
		{
			pos_sum=pos_sum + a;
			pos_count=pos_count+1;
		}
		else if (a < 0)
		{
			neg_sum=neg_sum + a;
			neg_count=neg_count+1;
		}
		scanf("%d",&a);
	}
	pos_average=pos_sum/pos_count;
	neg_average=neg_sum/neg_count;
	printf("Number of Positive numbers  =%d\n",pos_count);
	printf("Mean of Positive numbers    =%d\n",pos_sum);
	printf("Number of Negative numbers  =%d\n",neg_count);
	printf("Mean of Negative numbers    =%d\n",neg_sum);
	printf("Average of Positive numbers =%f\n",pos_average);
	printf("Average of Negative numbers =%f",neg_average);

	getch();
}