Read the program below and answer the questions that follow. #include <stdio.h>
ID: 3533419 • Letter: R
Question
Read the program below and answer the questions that follow.
#include <stdio.h>
#include <stdlib.h>
main()
{
int i, sum;
srand(1234);
for (i=0; i<5; i++)
printf("%d ", 5 + rand()%5);
printf(" ");
srand(1234);
sum = 0;
for (i=0; i<5; i++)
sum += (rand()%5);
printf("average = %5.2f ", (float)sum / 5);
}
This program will print two lines to the display.
The first line is
8 8 6 8 6
What is the second line?
Explanation / Answer
average=2.5
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.