How to get the last digit of int number in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int n = 87253;

        Console.WriteLine(n % 10);
    }
}



/*
run:

3

*/

 



answered Aug 29, 2019 by avibootz

Related questions

1 answer 143 views
1 answer 170 views
4 answers 312 views
1 answer 178 views
1 answer 130 views
1 answer 212 views
1 answer 166 views
...