# Check that if large number is divisible by 10

Here given code implementation process.

``````// Java program for
// Check that if large number is divisible by 10
public class Divisibility
{
public void isDivisibleBy10(String num)
{
// Condition
// ➀ Last digit of given number must be zero
boolean result = false;
int n = num.length();
if (n >= 1 && num.charAt(n - 1) == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
System.out.print(" Given number (" +
num + ") is divisible by 10\n");
}
else
{
System.out.print(" Given number (" +
num + ") is not divisible by 10\n");
}
}
public static void main(String[] args)
{
// Test
}
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````// Include header file
#include <iostream>
#include <string>

using namespace std;
// C++ program for
// Check that if large number is divisible by 10
class Divisibility
{
public: void isDivisibleBy10(string num)
{
// Condition
// ➀ Last digit of given number must be zero
bool result = false;
int n = num.length();
if (n >= 1 && num[n - 1] == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
cout << " Given number (" << num << ") is divisible by 10\n";
}
else
{
cout << " Given number (" << num << ") is not divisible by 10\n";
}
}
};
int main()
{
// Test
return 0;
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````// Include namespace system
using System;
// Csharp program for
// Check that if large number is divisible by 10
public class Divisibility
{
public void isDivisibleBy10(String num)
{
// Condition
// ➀ Last digit of given number must be zero
Boolean result = false;
int n = num.Length;
if (n >= 1 && num[n - 1] == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
Console.Write(" Given number (" +
num + ") is divisible by 10\n");
}
else
{
Console.Write(" Given number (" +
num + ") is not divisible by 10\n");
}
}
public static void Main(String[] args)
{
// Test
}
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````package main

import "fmt"
// Go program for
// Check that if large number is divisible by 10

func isDivisibleBy10(num string) {
// Condition
// ➀ Last digit of given number must be zero
var result bool = false
var n int = len(num)
if n >= 1 && num[n - 1] == '0' {
// When of number last digit is zero
result = true
}
if result == true {
fmt.Println(" Given number (",
num, ") is divisible by 10")
} else {
fmt.Println(" Given number (",
num, ") is not divisible by 10")
}
}
func main() {

// Test
isDivisibleBy10("12293893483940")
isDivisibleBy10("2342348234")
isDivisibleBy10("23982310")
isDivisibleBy10("33282949823490")
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````<?php
// Php program for
// Check that if large number is divisible by 10
class Divisibility
{
public	function isDivisibleBy10(\$num)
{
// Condition
// ➀ Last digit of given number must be zero
\$result = false;
\$n = strlen(\$num);
if (\$n >= 1 && \$num[\$n - 1] == '0')
{
// When of number last digit is zero
\$result = true;
}
if (\$result == true)
{
echo(" Given number (".\$num.
") is divisible by 10\n");
}
else
{
echo(" Given number (".\$num.
") is not divisible by 10\n");
}
}
}

function main()
{
// Test
}
main();``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````// Node JS program for
// Check that if large number is divisible by 10
class Divisibility
{
isDivisibleBy10(num)
{
// Condition
// ➀ Last digit of given number must be zero
var result = false;
var n = num.length;
if (n >= 1 && num.charAt(n - 1) == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
console.log(" Given number (" +
num + ") is divisible by 10");
}
else
{
console.log(" Given number (" +
num + ") is not divisible by 10");
}
}
}

function main()
{
// Test
}
main();``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````#  Python 3 program for
#  Check that if large number is divisible by 10
class Divisibility :
def isDivisibleBy10(self, num) :
#  Condition
#  ➀ Last digit of given number must be zero
result = False
n = len(num)
if (n >= 1 and num[n - 1] == '0') :
#  When of number last digit is zero
result = True

if (result == True) :
print(" Given number (", num ,") is divisible by 10")
else :
print(" Given number (", num ,") is not divisible by 10")

def main() :
#  Test

if __name__ == "__main__": main()``````

#### Output

`````` Given number ( 12293893483940 ) is divisible by 10
Given number ( 2342348234 ) is not divisible by 10
Given number ( 23982310 ) is divisible by 10
Given number ( 33282949823490 ) is divisible by 10``````
``````#  Ruby program for
#  Check that if large number is divisible by 10
class Divisibility
def isDivisibleBy10(num)
#  Condition
#  ➀ Last digit of given number must be zero
result = false
n = num.length
if (n >= 1 && num[n - 1] == '0')
#  When of number last digit is zero
result = true
end

if (result == true)
print(" Given number (", num ,") is divisible by 10", "\n")
else

print(" Given number (", num ,") is not divisible by 10", "\n")
end

end

end

def main()
#  Test
end

main()``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10
``````
``````import scala.collection.mutable._;
// Scala program for
// Check that if large number is divisible by 10
class Divisibility()
{
def isDivisibleBy10(num: String): Unit = {
// Condition
// ➀ Last digit of given number must be zero
var result: Boolean = false;
var n: Int = num.length();
if (n >= 1 && num.charAt(n - 1) == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
println(" Given number (" + num + ") is divisible by 10");
}
else
{
println(" Given number (" + num + ") is not divisible by 10");
}
}
}
object Main
{
def main(args: Array[String]): Unit = {
var task: Divisibility = new Divisibility();
// Test
}
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````
``````import Foundation;
// Swift 4 program for
// Check that if large number is divisible by 10
class Divisibility
{
func isDivisibleBy10(_ num: String)
{
// Condition
// ➀ Last digit of given number must be zero
var result: Bool = false;
let n: Int = num.count;

if (n >= 1 && Array(num)[n - 1] == "0")
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
print(" Given number (", num ,") is divisible by 10");
}
else
{
print(" Given number (", num ,") is not divisible by 10");
}
}
}
func main()
{
// Test
}
main();``````

#### Output

`````` Given number ( 12293893483940 ) is divisible by 10
Given number ( 2342348234 ) is not divisible by 10
Given number ( 23982310 ) is divisible by 10
Given number ( 33282949823490 ) is divisible by 10``````
``````// Kotlin program for
// Check that if large number is divisible by 10
class Divisibility
{
fun isDivisibleBy10(num: String): Unit
{
// Condition
// ➀ Last digit of given number must be zero
var result: Boolean = false;
val n: Int = num.length;
if (n >= 1 && num.get(n - 1) == '0')
{
// When of number last digit is zero
result = true;
}
if (result == true)
{
println(" Given number (" +
num + ") is divisible by 10");
}
else
{
println(" Given number (" +
num + ") is not divisible by 10");
}
}
}
fun main(args: Array < String > ): Unit
{
// Test
}``````

#### Output

`````` Given number (12293893483940) is divisible by 10
Given number (2342348234) is not divisible by 10
Given number (23982310) is divisible by 10
Given number (33282949823490) is divisible by 10``````

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

### New Comment 