C examples for Statement:if
Loops through 10 numbers and tests for odd and prints the even message
#include <stdio.h> int main()/*from w w w .jav a 2 s .com*/ { for (int i = 1; i <= 10; i++){ if ((i%2) == 1) // Odd numbers have a remainder of 1 { printf("odd\n"); continue; } printf("Even!\n"); } return 0; }