C examples for Statement:if
Checks if two numbers are are evenly divisible.
#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; }