# Divisibility | Practice problem Hackerearth solution

__ Problem:-__

You are provided an array

$A$of size

$N$that contains non-negative integers. Your task is to determine whether the number that is formed by selecting the last digit of all the N numbers is divisible by

$10$.

Note: View the sample explanation section for more clarification.

Input format

- First line: A single integer
- Second line:

Output format

If the number is divisible by

$10$, then print

$Yes$. Otherwise, print

$No$.

Constraints

Last digit of

$85$is

$5$.

Last digit of

is

$5$.

Last digit of

is

$5$.

Last digit of

is

$1$.

Last digit of

is

$4$.

Therefore the number formed is

which is not divisible by

$10$.

__Code:-__

Here I am going to give you two solution first one is on the basis of C language and second one is on the basis of c++ language which you can submit in c++14 and c++17 also

__Solution 1 ( C language):-__

__Solution 2 ( C++ language):-__

In this solution first three lines of the main function is only for the decreasing the time of execution of the program..

This is your choice that you want to use this or not but in some cases the code may take more time in execution and that time we need it .

__Recommended Post:-__

- Very Cool numbers | Hacker earth solution
- Birthday party | Hacker earth solution
- Most frequent | hacker earth problem solution
- program to find symetric difference of two sets
- cost of balloons | Hacker earth problem solution
- Chacha o chacha | hacker earth problem solution
- jadu and dna | hacker earth solution
- Bricks game | hacker earth problem
- Anti-Palindrome strings | hacker earth solution
- connected components in the graph | hacker earth data structure
- odd one out || hacker earth problem solution
- Program to find cycle in the graph
- Implementation of singly link list
- Implementation of queue by using link list
- Algorithm of quick sort
- stack by using link list
- program to find preorder post order and inorder of the binary search tree
- How to set limit in the floating value in python
- What is boolean data type
- How to print any character without using format specifier