+ 3
I want to make a program where i can give an interval for my input.
...if my input not belong to the interval, then the program will close automatically.can anyone give me code for my questionex: int x; interval -> 0<x<100if x not belong to the interval, then program automatically out
4 Respuestas
+ 2
Just use an if.
public void foobar(int x, int ll, int hl) {
if ((x >= ll) && (x <= hl)) {
//...
}
}
+ 1
and, how to make program to close with automatically
0
if i understand you correct, to close your program you can call System.exit(0);
the zero can be any other integer value. it helps you to unterstand why and where your program quit
- 3
do you want to help me , you give a money small $5