Question: Write comments for a C program that the given example to explain your understanding of the code. #define _CRT_SECURE_NO_WARNINGS #include #include /*************************************************************************** Your Full Name:

Write comments for a C program that the given example to explain your understanding of the code.

#define _CRT_SECURE_NO_WARNINGS

#include

#include

/***************************************************************************

Your Full Name: ------------------------------

Briefly describe the purpose of the following program. (no more than 5 sentences).

-------------------------------------------------------------------------

*****************************************************************************/

int main()

{

int data[10];

int cont=0;

int sum=0;

int i;

float avg;

for(i = 0; i < 10; i++)

{

data[i] = rand();

}

for(i = 0; i < 10; i++)

{

if(data[i] % 2 == 0)

{

sum += data[i];

cont++;

}

}

avg = sum /cont;

printf("Avg = %f", avg);

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!