Check if a large number is divisible by 5 or not | C # program to find if a number is C # program to find if a number is divisible by 5 or not . ; Function to find that number divisible by 5 or not . The function assumes that string length is at least one . ; Driver Code
using System ; class IsDivisible { static bool isDivisibleBy5 ( String str ) { int n = str . Length ; return ( ( ( str [ n - 1 ] - '0' ) == 0 ) || ( ( str [ n - 1 ] - '0' ) == 5 ) ) ; } public static void Main ( ) { String str = "76955" ; if ( isDivisibleBy5 ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }