Program to print all odd numbers from m to n using for loop

0
26
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,n,m;    /*  i for loop counter, m is lower limit, n for upper limit */
 clrscr();
 printf("\n Enter lower limit & upper limit \n");
 scanf("%d%d", &m &n); 
 printf("\n odd numbers from %d to %d are \n", m, n);
 for(i=m; i<=n; i++)
     if(i%2==1)     /*  odd numbers are not divisible by 2 */
        printf("%5d",i);
getch();
}
  Output:
  Enter the lower & upper limit
  10 20 
  odd numbers from 10 to 20 
  11 13 15 17 19

 

 

 

Program to print all odd numbers from m to n using for loop Program to print all odd numbers from m to n using for loop in c C Program to print all odd numbers from m to n using for loop odd numbers from m to n odd number program using loop odd number program between of two numbers for loop program program to find odd numbers from m to n program to find odd numbers

LEAVE A REPLY

Please enter your comment!
Please enter your name here