0

Write a program that reads integers, finds the largest and counts the occurrences. Assume that when the user enters it ends the sequence.

Example :
3 5 5 5 0
Largest : 5
Occurrences : 3

I can't use arrays .
I know I'm suppose to use loops but I can't just figure it out . I would greatly appreciate any help !

C programming

3
Contributors
2
Replies
10
Views
2 Years
Discussion Span
Last Post by jnneson
0

You need to do some plan work...
First, how many digit is the user allow to enter?
Use a sorting method to check which one is greater(greatest)
let say a, b, c d e f,
If a>b, then compare (a) with c etc...
The greater one will retain the subject of comparison ...
Also check, if new value is equal to the greatest value, then the older value continue, then you define a variable to hold the occurence count.... Hope I have help

Edited by jnneson

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.