Please answers the following two questions using Language C
Please answers the following two questions using Language C.
1)
Given that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 months of the year in order (i.e., January, February, etc.), write a statement that writes to standard output the element corresponding to October.
Do not write anything else out to standard output .
2)
Given an int variable count that has already been declared , write a for loop that prints the integers 50 through 1, separated by spaces. Use no variables other than count.
Solution
Question 1:
Answer: printf(\"October sales: %d\", monthSales[9]);
in monthSales array, 12 months sales will store from index 0 to 11. If we wnat to display a sales fr month of october, we have fetch the corresponding value from 9th index of monthSales array.
Question 2:
Answer:
for(count = 50; count >=1; count --){
printf(\"%d \", count);
}
