Find missing number in sequence

To find missing number in sequence, Use below given code :

            var list = new List<int>(new[] { 1, 2, 4, 7, 9 });
            var result = Enumerable.Range(1, 10).Except(list);

            foreach (int i in result)
            {
                Console.WriteLine(i.ToString());
            }
            Console.Read();


When you run above given code you will get missing numbers :
3
5
6
8
10

Comments

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

Change Language for current user with JSOM in SharePoint Online

SharePoint 2010 CSS Chart