fun main(args: Array<String>) { var total = 200 printIn(total % 7) } | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

fun main(args: Array<String>) { var total = 200 printIn(total % 7) }

Q. You are making gift boxes. Each box contains 7 items. Given 200 items in total, you need to calculate and output how many items will be left over , if you create gift boxes from all of the items. (The modulo operator % can be useful to solve the challenge.)

17th Jan 2023, 8:49 AM
Anmol.
2 Answers
+ 1
let items = 200; console.log(items%7);
24th Mar 2023, 5:50 AM
A UDAY SHANKAR
A UDAY SHANKAR - avatar
+ 1
BS
1st Aug 2023, 12:26 AM
nothing
nothing - avatar