Checks if two numbers are are evenly divisible. - C Statement

C examples for Statement:if

Description

Checks if two numbers are are evenly divisible.

Demo Code

#include <stdio.h>

int main (void)
{
    int i1, i2;/*  w  ww.j  a  v a2  s . c  om*/

    printf ("Enter two numbers: ");
    scanf("%i%i", &i1, &i2);

    if (i1 % i2 == 0)
        printf("%i is evenly divisible by %i", i1, i2);
    else
        printf("%i is not evenly divisible by %i", i1, i2);

    return 0;
}

Result


Related Tutorials