Hey guys,
I need help with 2 programs. The first one compiles and runs but doesn't print the results. The code is below.
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("%.2f", &sales[i - 1]);
}
return(0);
}
The second one I need a user to input 10 numbers and then show them a menu with 2 options, to sort in ascending or descending order. I really need help.
Code:
#include <stdio.h>
int Number[10];
int count;
main()
{
for(count=1;count<11;count++)
{
printf("Please enter a number: ");
scanf("%d", &Number[count]);
}
for (count=1;count<11;count++)
{
thanks a bunch
SweetOne