How to find out the missing numbers from a list of numbers containing 1 to 25


#1

I have a list of numbers from 1 to 25 among which a few numbers are missing. How can I get back the missing numbers?


#2

Iterate below in for each loop

Enumerable.Range(1, 25).Except(list)

and use InvokeMethod to add each number to your list.


#3

not working …:frowning:


#4

You have to be more specific then “not working”. Your list is not getting updated or any syntax error?


#5

I have used the below list :
{1, 2, 3, 5, 6 , 8 , 9, 10}

Output should be 4 and 7

Not coming


#6

May be you are missing something, works for me. I’m adding missing numbers to list, if you want to know missing numbers just keep writeline in foreach (num.ToString)


#7

Please provide me the entire sequence screenshot…that will help me a lot in learnng…i might be missing something for sure


#8

missinglist.xaml (8.2 KB)


#9

thanks a ton…it works now