Computer Science, asked by JersonHaobam, 11 months ago

write a c program to display all odd numbers between 1 to n using 4 loop

Answers

Answered by rnks69
2

Answer:

#include <stdio.h>

int main()

{

   int i, n;

   printf("Enter the limit you want to get upto that: ");

   scanf("%d", &n);

   printf("Odd numbers from 1 to %d are: \n", n);

   for(i=1; i<=n; i++)

   {

       if(i%2!=0)

       {

           printf("%d\n", i);

       }

   }

   return 0;

}

Explanation:

Similar questions