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

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?

Iterate below in for each loop

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

and use InvokeMethod to add each number to your list.

not working …:frowning:

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

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

Output should be 4 and 7

Not coming

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)

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

missinglist.xaml (8.2 KB)

thanks a ton…it works now