C programs to print n odd numbers.

#include<stdio.h>
#include<conio.h>
int main()
{
    int n, i;
    printf("Enter the value of n(limit): ");
    scanf("%d", &n);
    printf("\nAll Even Numbers from 1 to %d:\n", N);
    for(i=1; i<=n; i++)
    {
        if(i%2 != 0)
            printf("%d ", i);
    }
    getch();
    return 0;
}
C programs to print n odd numbers. C programs to print n odd numbers. Reviewed by on December 22, 2019 Rating: 5

No comments:

Powered by Blogger.