Hey up everyone.
Right, this is whats baffling me. I want to read in a set of numbers (10), either positive or negative, and find the separate totals of both (if this is possible).
I have the following code:
Code:
#include <stdio.h>
int i,totpos,totneg;
int main()
{
for (i=0;i<10;i++)
{
printf("Enter number %d...",i);
scanf("%d",&number[i]);
}
//
printf("The totals of your positive numbers is: %d",totpos);
printf("The totals of your negative numbers is: %d",totneg);
return(0);
}
but I don't know how you add up, seprately, both the positive and negative integers! How would you distinguish between the two??
Any help would be much appriciated on this!
Cheers,
Chris.