Using the if statement

Tuesday, October 14, 2014
/* 1001.c Using the if statement */
#include <stdio.h>

main()
{
    int i;

    printf("Integers that can be divided by both 2 and 3\n");
    printf("(within the range of 0 to 100):\n");
    for (i=0; i<=100; i++){
        if ((i%2 == 0) && (i%3 == 0))
        printf(" %d\n", i);
    }
    return 0;
}

Copyright @ 2015 Tron!

Labels

Blog Archive