Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Monday 14 November 2016

URI-1067

URI Online Judge | 1067

Odd Numbers

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem link Click here
Read an integer value (1 <= <= 1000).  Then print the odd numbers from 1 to X, each one in a line, includingif is the case.

Input

The input will be an integer value.

Output

Print all odd values between 1 and X, including if is the case.
Input SampleOutput Sample
81
3
5
7

Solution...

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

No comments:

Post a Comment