/* This program prints the numbers from 1 to 50 divisible by 2 or 3 */ #include<stdio.h> int main() { int i; printf("The numbers from 1 to 50 divisible by 2 or 3 are : \n"); for (i = 1 ; i <= 50 ; i++) { if ( i % 2 == 0 || i % 3 == 0) { printf("\t %d\n", i); } } return 0; }
Comments
Post a Comment