Find the number which is repeated mostly

#include
#include
#include


void main(void)
{
int arr[]={5,8,1,8,4,8,8,5};
int i,j,max=0,maxt=0,tempt,temp=0;;
for(i=0;i<8;i++)
{ tempt=0;
for(j=i+1;j<=8;j++)
{if(arr[i]==arr[j])
tempt++;
}
if(tempt>maxt)
{
max=arr[i];
maxt=tempt;
}
}

printf("the no%d is repeated",max);
printf(" %d times",maxt);
scanf("%d",max);
}

Comments