Starting from:

$30

COM1002 Lab 3 -Solved

Write a C program which reads a set of numbers, un7l the EOF, from stdin and prints the number of items read from stdin and computes the mean of the sum of the squares of these numbers, excluding the numbers that are divided by 3 or 5, evenly. The computed mean is printed to stdout in 2 point precision. For example:

for the following input:  Sample Input: 2 4 15 8 9 11

your program first prints 6, since there are 6 items read from the stdin and must calculate and print the sum of the squares, excluding  15 and 9, as follows:  

2*2+4*4+8*8+11*11 =205

Then, the mean is computed as: 205/4 = 51.25

Output: 6  51.25 I/O format: 

input: <set of integers> output: <# of items read>[Space]<mean computed as specified>

SuggesRon: 

More products