1070 Six Odd Numbers

SemiColon
By -
0
URI Online Judge | 1070

Six Odd Numbers

Read an integer value and print the 6 consecutive odd numbers from X, a value per line, including if it is the case.

Input

The input will be a positive integer value.

Output

The output will be a sequence of six odd numbers.
Input SampleOutput Sample
89
11
13
15
17
19



 Solution:
#include <stdio.h>
int main()
{
    int X,a,b;
    scanf("%d", &X);
    if(X%2==0)
    {
        for(a=X+1;a<=X+11;a=a+2)
            printf("%d\n",a);
    }
    else
    {
        for(b=X;b<=X+10;b=b+2)
            printf("%d\n",b);
    }
    return 0;
}


Tags:

Post a Comment

0Comments

Post a Comment (0)