Program in C to print Odd numbers from 1 to 20

Write a program in C to print Odd numbers from 1 to 20

#include <stdio.h>

void main ()
{
          int a;
          clrscr ();
          a=1;
          while (a<=20)
          {
                   if (a%2==1)
                             printf ("\n%d",a);
                   a++;
          }
          getch ();
}


Post a Comment