Easy C Program to check divisibility of number by 10

 c program to check whether entered number is divisible by 10

       By using this program we can check whether the entered number is divisible by 10 or not, so first let us understand what is divisibility of a number by 10. It means that, when a number  is divided by 10 we get 0 as reminder in first division, then that number is said to be divisible by 10. For example let us take 19, Here if we divide 19 by 10 we get 9 as reminder at first division therefore 19 is not divisible number by 10.

     Where as if we take some another number like 20, In this case if we divide 20 by 10 we get reminder as 0. so 20 is a divisible number by 10. This program work using this logic only.  


Program:

#include <stdio.h>
#include <conio.h>
// Program to check entered number is divisible by 10. SlashMyCode.com
void main()
{
    int a;
    printf("Enter a Number \n");
    scanf("%d",&a);

    if (a%10==0)
        {
        printf("The number %d is divisible by 10",a);
        }
       else
          {
          printf("The number %d is NOT divisible by 10",a);
          }
// Program to check entered number is divisible by 10. SlashMyCode.com
    getch();
}



Output:


output of  c program to check whether entered number is divisible by 10

No comments:

Post a Comment

Feel free to ask us any question regarding this post