hi sudheer, by using Mod function, we can achieve it. lool below apex code.
for(Integer i=1; i<=100 ; i++){
Integer count= math.mod(i, 2);
/*this line will return 0 Or 1. if we are getting number which can be divided by 2 then return 0 or else 1*/
if(count == 0){
System.debug(i+' is divisible by 2 ');
}
}
let me know by marking it as best answer if it helps you. Thank you
I think that you have not specified the path itself. The code is not such a simple thing as it might seem at first glance. I started learning Java Script a year ago and realized how much I lack mathematical knowledge. I used to always use https://plainmath.net/post-secondary to solve and find an answer to any college math problems and it helped me a lot. But I never wanted to study on my own, because I spared time and was lazy. Now I realized that mathematics is very closely related to many other sciences and specialties.
Hi Sudheer,
Please try the following code :
Please mark it as the best answer if it resolves your issue.
Thanks.
by using Mod function, we can achieve it.
lool below apex code. let me know by marking it as best answer if it helps you.
Thank you
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
did you try my solution. please let us know by marking it as best answer.
Thank you