if lines is equal to 6, then its going to print out 7 elements (the last one being garbage value). I know I can do for(i = 0; i<=(lines-1); i++) but is there an alternative?Code:void printoutput(const float prices[], const char taxable[], const int lines)
{
int i;
puts("Price Taxable");
puts("----- -------");
for(i = 0; i<=lines; i++){
printf("%2.2f%5c\n",prices[i],taxable[i]);
}
}