How do I write in code if (x %(any number but x)==0) ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I write in code if (x %(any number but x)==0) ?

27th Feb 2022, 9:52 PM
Maram Jamal
1 Answer
+ 1
I think it would involve the ternary operator. Maybe this? if (x%(y!=x? y : x+1)==0) Or this? if ((y!=x? x%y : 1)==0)
28th Feb 2022, 4:07 AM
Brian
Brian - avatar