Advertisement
udaykumar1997

mode of the given set of numbers

Aug 4th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. /// re3(9).cpp
  2. /* write a program to prompt the user to enter any 10 numbers and must calculate the mode of the given
  3.    set of numbers and display it */
  4. // mode: the number which appears the most frequently
  5. #include<iostream>
  6. #include<conio.h>
  7. #include<stdio.h>
  8. int punc(int,int);
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     int numbers[9],modee[9];
  14.     puts("this program will display the mode of the numbers entered by the user");
  15.     for(int nikki;nikki<=10;nikki++){cin>>numbers[nikki];}
  16.     for (int kaya;kaya<=9;kaya++){
  17.     modee[kaya]=punc(numbers[kaya],numbers[]);}
  18.     for(int disa=0;disa<=9;disa++){cout<<modee[disa];}
  19. }
  20.  
  21. int punc(int kala,int neela[]){int bypee=0;
  22.     for (int lolo;lolo<=10;lolo++){
  23.         if(kala==neela){bypee++;}
  24.         else{}
  25.         return bypee;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement