Let's see how to print odd numbers in range 1 to 10 using c language. Here you will be able to find the odd numbers with a simple algorithm when some one ask you how you will do it in math then you should say that i will divide all the number between 1 to 10 with 2 then i can find the odd numbers that can't divide with 2. so this simple think you can do in c programming that i could not in my exam so let's see and learn it.
how to print odd numbers in range 1 to 10 using c language
See this screenshot I run it in my device now you can also do it just copy the code i provided bellow and understand it. Don't forget to share if you also learning like me :) . I understand that practice makes a man perfect lol practice makes a man > programmer.
#include <stdio.h>
void main()
{
int i;
printf("Odd numbers in the range 1 to 10:\n");
for (i = 1; i <= 10; i += 2)
{
printf(" %d\n", i);
}
}
Latest Post Is Coming On Programming


0 Comments