Header Ads

Odd numbers between 1 to 100

C program for odd numbers between 1 to 100

Odd numbers : numbers when divided by 2 doesn't yield the reminder as 0 is known as odd number.
Example: 4 % 2 = 0 is not odd number but  5 % 2 != 0 is a odd number

#include<stdio.h>
#include<conio.h>
main()
{
    int i;
    printf("odd : ");
    for(i=1;i<=100;i++)
    {
        if(i%2!=0)
            printf("%d ",i);
    }
    getch();

}

Output

screenshot for output of odd number between 1 to 100
Related programs:

No comments