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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started