URI 1067 Solve

Solve of URI 1067 (Odd Numbers) in C

#include<stdio.h>
int main(void){
    int i,n;
    scanf("%d",&n);
    if(n%2==0)
        n=n-1;
    for(i=1;i<=n;i+=2)
        printf("%d\n",i);
    return 0;
}

Post a Comment

Previous Post Next Post