C Programming Given that the array monthSales of integers ha

(C Programming)

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 .

Solution

Answer: printf(\"October = %d\", monthSales[9]);

This statement will print sales of month October in standard output.

October month is 10 that month exist in monthSales  array in 9th index because array indexes will start from 0 to 11 for these 12 months sales.

(C Programming) 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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site