Here is my new code for the first one
PHP Code:
#include <stdio.h>
main()
{
char month[12][4];
int product[12];
float sales[12];
short i;
for (i = 1; i <= 12; i++) {
printf("\nEnter the month: ");
scanf("%s",month[i-1]);
printf("\nEnter number of products sold: ");
scanf("%d", &product[i - 1]);
printf("\nEnter sales: ");
scanf("%f", &sales[i - 1]);
}
for (i = 1; i <= 12; i++) {
printf("\nMonth:%s ",month[i-1]);
printf("\nNumber of products sold:%d ",product[i-1]);
printf("\nSales:%.2f ",sales[i-1]);
}
return(0);
}
Never mind..I had a .2 in my scan float for sales. I fixed that and it works like a charm. Now I need help with my second programming code from above
