> if (1<power<6000)
This isn't how you compare a value is between two range limits.
Your indentation needs work (as per the guidelines in your assignment).
You really should start to use functions to stop main becoming a
ball of mud.
For example,
Code:
// add parameters / return result(s) as required.
void processConsumer() {
printf("\nEnter Consumption Category:\n");
printf("1 = Residential\n");
printf("2 = Commercial\n");
printf("3 = Agricultural & charities\n");
printf("4 = Government \n");
printf("5 = Industrial \n");
printf("6 = Private Educational and Medical\n");
scanf("%d",&type);
// more of your code here
}
int main ( ) {
// more of your code here
printf("Recipient #%d information:\n",times);
printf("\nInsert current > ");
scanf("%d",¤t);
printf("\nInsert voltage > ");
scanf ("%d",&voltage);
if ( voltage != -1 && current != -1 ) {
processConsumer();
} else {
// print the final stats
}
// more of your code here
}
You store the max using the following code
Code:
int max = -1; // better is -INT_MAX
/// more code
// Keep track of the current max
if ( value > max ) max = value;
Minimum works in the same way, except you start with an impossibly large value, and you use < rather than >.