kunal5959
Junior Member level 3
I have a situation where i have to write a code in C for ATMEGA128 in AVR studio, so as to compare 5 integers that are being saved in the EEPROM and then to see which ones are equal and choose atleast 3 equal numbers of the 5 nrs. :-
e.g.
a=0,b=0,c=0,d=2,c=3
then Valid_nr=0,
a=6,b=0,c=6,d=6,c=6
then Valid_nr=6,
a=8,b=8,c=8,d=8,c=8
then Valid_nr=8
Please suggest me some logic because this seems to be very confusing to write a short and efficient code to achieve this..
e.g.
a=0,b=0,c=0,d=2,c=3
then Valid_nr=0,
a=6,b=0,c=6,d=6,c=6
then Valid_nr=6,
a=8,b=8,c=8,d=8,c=8
then Valid_nr=8
Please suggest me some logic because this seems to be very confusing to write a short and efficient code to achieve this..