Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "stats.h"
- /* Size of the Data Set */
- #define SIZE (40)
- unsigned char maximal,minimal, median, mean;
- void print_statistics(){
- printf("%c", maximal);
- printf("%c", ' ');
- printf("%c", minimal);
- printf("%c", ' ');
- printf("%c", median);
- }
- void print_array(unsigned char data[]){
- for(int i = 0;i<SIZE;++i){
- printf("%c", data[i]);
- printf("%c", ' ');
- }
- }
- unsigned char find_minimum(unsigned char data[]){
- unsigned char temp = data[0];
- for(int i = 0;i<SIZE;++i){
- if(temp>data[i]){
- temp=data[i];
- }
- }
- return temp;
- }
- unsigned char find_maximum(unsigned char data[]){
- unsigned char temp = data[0];
- for(int i = 0; i<SIZE; ++i){
- if(temp>data[i]){
- temp=data[i];
- }
- }
- return temp;
- }
- void main() {
- unsigned char test[SIZE] = { 34, 201, 190, 154, 8, 194, 2, 6,
- 114, 88, 45, 76, 123, 87, 25, 23,
- 200, 122, 150, 90, 92, 87, 177, 244,
- 201, 6, 12, 60, 8, 2, 5, 67,
- 7, 87, 250, 230, 99, 3, 100, 90};
- }
- /* Add other Implementation File Code Here */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement