+ 1

WAP in C to calculate central tendency mean mode median of of an array of size 25

If more than one elements occurs most often in the array, then the mode will be the element that is the greatest among all of them. https://code.sololearn.com/cm8S4o7c1ctB/?ref=app https://code.sololearn.com/c232U5WLPpE7/?ref=app

29th Jun 2022, 9:02 AM
Shekhar Rajbhar
Shekhar Rajbhar - avatar
8 Respostas
+ 1
Shekhar Rajbhar Attempts?
29th Jun 2022, 9:22 AM
A͢J
A͢J - avatar
+ 1
There are several issues: not initialized variables, spelling errors, using an int for mean... I recommend you to test your code with a pre-defined, short array, not with long user input. I made comments in the code, please review it: https://code.sololearn.com/cjdtCjN8l87r/?ref=app
29th Jun 2022, 12:18 PM
Lisa
Lisa - avatar
+ 1
Try to 1st make a working code before you start to rewrite code or remove function. For the execution speed, I don't think that 25 values and few function are an issue. Also consider clarity and reusability – functions are great for that.
29th Jun 2022, 12:28 PM
Lisa
Lisa - avatar
0
Strange, I could have sworn someone had posted a similar question a few hours ago... As already mentioned: Please show what you have tried to solve the task. Do not expect other people to do your homework for you. If you want to revise the basics before doing the task, check on the sololearn C course.
29th Jun 2022, 10:06 AM
Lisa
Lisa - avatar
0
ohh sorry that's was me
29th Jun 2022, 10:08 AM
Shekhar Rajbhar
Shekhar Rajbhar - avatar
0
Actually I haven't mention full prob I find out mean and median but i am stuck in finding the largest mode from the multiple modes
29th Jun 2022, 10:13 AM
Shekhar Rajbhar
Shekhar Rajbhar - avatar
0
Please link your code so we can see where exactly you are stuck. You may also like to look at how others approach the task: https://www.sanfoundry.com/c-program-find-mode-array/ https://www.tutorialspoint.com/learn_c_by_examples/mode_program_in_c.htm
29th Jun 2022, 10:20 AM
Lisa
Lisa - avatar
0
Thankyu maam because of you I succeed
30th Jun 2022, 7:48 AM
Shekhar Rajbhar
Shekhar Rajbhar - avatar