Beecrowd-1070 Six Odd Numbers Solution

Beecrowd-1070 Six Odd Numbers Solution

Beecrowd 1070

Six Odd Number

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

Beecrowd 1070 Six Odd Numbers Solution in C

#include<stdio.h>
int main()
{
    int x,i;
    scanf("%d",&x);
     if(x%2==0)x++;
    for(i=0;i<6;i++){

        printf("%d\n",x);
        x=x+2;

    }
    return 0;
}

Solution in C++

#include<iostream>
using namespaces std;
int main()
{
int x;
cin>>x;
if(x%2==0)x++;
for(int i=0;i<6;i++)
{ cout<<x<<endl;
x=x+2;
}
return 0;
}

Beecrowd All solution

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck