❔ Using WHILE to sum numbers from 10 until sum == 1000

Hello, how to make using function while () {} to make numbers from 10 to be sum until result is 1000 for example:
10 + 10 (first time)
20 + 11 (2th time)
31 + 12 (3rd time)
43 + 13 (4th time) and etc until result is 1000 also to print the last number after +

my broken code:
            int i = 10;
            int a = 0;

            while (i <= 1000)
            {
                a = a + i;
            }

            Console.WriteLine(a);
Was this page helpful?