
Six Odd Numbers
By Neilor Tonin, URI Brazil
Read an integer value X and print the 6 consecutive odd numbers from X, a value per line, including X 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 Sample | Output Sample |
8 |
9 |
N.B.: It's better if you solve this by your own. Thank you!
URI - BEECROWD Online Judge 1070 Solve in C:
//Solved by Intesar#include <stdio.h>
int main() {
int x,i=0;
scanf("%d",&x);
while(i<6) { if(x%2!=0) { printf("%d\n",x); x++; i++; } else x++; }
return 0;}
0 Comments