Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

d. How will lack of trust be handled?

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago