Question: IN C LANGUAGE: Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp

IN C LANGUAGE:

Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp = {90, 92, 94, 95}, print:

90, 92, 94, 95 

Your code's output should end with the last element, without a subsequent comma, space, or newline.

#include

int main(void) { const int NUM_VALS = 4; int hourlyTemp[NUM_VALS]; int i;

for (i = 0; i < NUM_VALS; ++i) { scanf("%d", &(hourlyTemp[i])); }

/* Your solution goes here */

printf(" ");

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!