This is my solution, but the Output is as follows:-
Contains Duplicate Number:7 Count 2
Contains Duplicate Number:7 Count 3Is there a way i can get only 1 Output like this :-
Contains Duplicate Number:7 Count 3
Any Help Appreciated
Code:int num =677827,i=0,rem=0;
int seen[10]={0};
while(num >0) {
rem = num %10;
seen[rem] ++;
num/=10;
if((seen[rem]) >1 ) {
printf("\nContains Duplicate Number:%d Count : %d",rem,seen[rem]);
}
}