abhas Active member
| Subject: ISC JAVA Algorithm to display mode and mode frequency Wed Nov 25, 2009 7:45 pm | |
| Algorithm to display mode and mode frequency in an array.
1. Start
2. Declare variable (mode, freqatmode, marks[])
3. Input the marks of 10 students and store it in the array – marks[]
4. Initialize variables to store mode and mode frequency
(LET mode 0, LET freqatmode 0 )
5. Run a loop from 0 to 100 and find frequency of each number in the array – marks[]
6. If frequency of any number is greater than or equal to f, then store the number in mode and frequency in freqatmode
7. Print the mode and the mode frequency
8. Stop |
|