#include int small; int buffer; int array[10]; int a; int b; int newer[23]; int last; int t; int k; //int more_than_1_mod; int most; int most_freq; int main() { array[0]=22; array[1]=5; array[2]=4; array[3]=12; array[4]=12; array[5]=7; array[6]=9; array[7]=1; array[8]=13; array[9]=14; printf ("\nThe original datum are:\n"); printf ("************************************\n"); printf ("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",array[0],array[1],array[2],array[3],array[4],array[5],array[6],array[7],array[8],array[9]); newer[0]=0; newer[1]=0; newer[2]=0; newer[3]=0; newer[4]=0; newer[5]=0; newer[6]=0; newer[7]=0; newer[8]=0; newer[9]=0; newer[10]=0; newer[11]=0; newer[12]=0; newer[13]=0; newer[14]=0; newer[15]=0; newer[16]=0; newer[17]=0; newer[18]=0; newer[19]=0; newer[20]=0; newer[21]=0; newer[22]=0; for (k=9;k>=0;k--) { for (a=9;a>=0;a--) { if (array[a]-array[a-1]<0) { //printf ("now"); buffer=array[a]; array[a]=array[a-1]; array[a-1]=buffer; } //else //{ //printf ("ohoh"); //} } } printf ("\nAfter some arrangement...\n"); printf ("************************************\n"); for (last=0;last<=9;last++) { printf ("%d\t",array[last]); } printf ("\n"); //printf ("\n%d\n",array[0]); //printf("Hello World\n"); // return 0; for (b=1;b<=10;b++) { for (a=1;a<=22;a++) { //printf ("te"); if (array[b-1]==a) { //printf ("ahha"); //printf ("\n%d\n",a); newer[a]=newer[a]+1; } } } //printf ("\n%d\n",newer[4]); //printf ("\n%d\n",newer[5]); printf ("\nSummary :\n "); printf ("**************************\n"); for (a=0;a<=22;a++) { printf ("Frequency of no. %d : \t %d\n",a,newer[a]); } most=0; for (a=0;a<=22;a++) { if (most-newer[a]<0) { most=newer[a]; most_freq=a; //printf ("\nupdate\n%d",most_freq); //printf ("\n\n%d",n) } } printf ("\nWARNING:Assume that there is only one MOD for the datum & the MOD is not equal to zero..."); printf ("\n*****************************************************************"); printf ("\nMod is %d\n",most_freq); printf ("\nThis is an 30 days trail version program. Thank you for using TCS product!\n\n"); printf ("Ah Sai please understand the program BEFORE you modify it. I'm sure you can't mofidy it if you're not understand those flows. So i stop here and the other i let you complete lar. Emm...New layout project will arrive very soon. I think next week i probably need to have a lot of OT to complete the project in time...\n\n"); //} }