Calculate Sum, Average, Variance and Standard Deviation: C Program
Satish B
https://technotip.com/7955/calculate-sum-average-variance-and-standard-deviation-c-program/
Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the results in main().
Very Important Note: Any address preceded by a * (Indirection operator) will fetch the value present at that address.
Using below formula we calculate sum, average/mean, variance and standard deviation:
*sum = a + b + c + d + e; *avg = *sum / 5.0;
*variance = ( (a – *avg) x (a – *avg) + (b – *avg) x (b – *avg) + (c – *avg) x (c – *avg) + (d – *avg) x (d – *avg) + (e – *avg) x (e – *avg) ) / 5.0;
*standard_deviation = sqrt(*variance);
C Programming Interview / Viva Q&A List https://technotip.com/6378/c-programming-interview-viva-qa-list/
C Programming: Beginner To Advance To Expert https://technotip.com/6086/c-programming-beginner-to-advance-to-expert/ ... https://www.youtube.com/watch?v=2CU6uSjyndA
24589792 Bytes