C Program to display the numbers from 1 to 50 which are divisible by 2


  1. /* This program displays the numbers from 1 to 50 which are divisible by 2 */
  2.  
  3. #include <stdio.h>
  4.  
  5. int main() {
  6.  
  7. int i;
  8.  
  9. printf("The numbers from 1 to 50 which are divisible by 2 are given below\n");
  10.  
  11. for (i=1 ; i<=50 ; i++) {
  12. if (i % 2 == 0) {
  13. printf("%d\n", i);
  14. }
  15. }
  16.  
  17. return 0;
  18. }

Comments