How to use int.MaxValue in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] arr = new long[]
            {
                3243512345344190889L,
                1000L,
                9999999999999999L,
                8989L,
                110000000
            };

            int maxint = int.MaxValue;

            foreach (long l in arr)
            {
                if (l > maxint)
                    Console.WriteLine(l);
            }
        }
    }
}

/*
run:
   
3243512345344190889
9999999999999999

*/

 



answered Jan 19, 2017 by avibootz

Related questions

1 answer 167 views
167 views asked Jan 19, 2017 by avibootz
1 answer 109 views
109 views asked Nov 16, 2021 by avibootz
1 answer 96 views
96 views asked Jul 23, 2020 by avibootz
1 answer 148 views
148 views asked Aug 21, 2018 by avibootz
1 answer 351 views
1 answer 159 views
1 answer 153 views
...