i want to know how to give cnstraints to variable . like {0 < N1 < 100 0 < N2 < 100} this one.
How to give constraints
Hey Divyanshu, you can use these constraints for a variable according to your problem.
for eg. if you want to traverse N1 from 0 to 100 in a for loop, you an do that as
for (int N1=0;N1<=100;N1++){
// do something
}
or if you want to do some work when 0<N1<100 then you can do it as
if(N1>0 && N1 < 100){
// do something
}
Hey Divyanshu … I think you are misunderstanding the meaning of constraint…
Constraint are just saying that your code will be tested on given value like n<100.
You dont have to write that
if(n<100)
it is just saying that your code should work for any number n that is less than 100