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 140 views
1 answer 167 views
4 answers 307 views
1 answer 175 views
1 answer 126 views
1 answer 211 views
1 answer 163 views
...