CSE107 – Lab09 Task solution

$24.99

Original Work ?

Download Details:

  • Name: Lab9-wfziae.zip
  • Type: zip
  • Size: 88.24 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (8 votes)

Write a C program that performs the task described below. Name your c
file as nameSurnameId.c [ex: basakKarakas1850044026.c]
Upload your file to your section’s submission page on moodle.
1 Task
In statistics, the mode is the most frequently observed value in a data set.
In this task, you must compute the mode of a set of 100 elements.
Firstly, build the set with integers between 1 and 10 that will be randomly
generated. Then define and use the following functions to calculate the mode.
Show how many of each element the set contains before showing its mode.
The screenshot should look like the one below:
Functions:
• int find mode(int n, int arr[ ]);
This function finds the mode of an array with n elements.
• int find number of x(int x, int n, int arr[ ]);
This function finds how many x are in an array with n elements.
• int find max(int arr[ ]);
This function finds the maximum element of an array with 10 elements.
Good luck 🙂
1