Natural numbers between a range of two numbers separated by a single space.
Anonymous:
___k off
Answers
Answered by
0
public static void printRange( int x, int y) {
if(y > x) {
for (int j = x; j <= y; j++) {
int i = 1*j + (x - 1);
System.out.print(j + " ");
}
}
else if (x > y){
for (int j = x; j>= y; j--) {
int i = -1*y + (x -y +1) * 2 +1;
System.out.print(j + " ");
}
}
else {
System.out.print(x);
}
}
Answered by
0
THE ANSWER IS 1.i think I am right.
Similar questions
English,
8 months ago
Social Sciences,
8 months ago
Math,
8 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago