Challenge :: Make a code to get Numbers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

Challenge :: Make a code to get Numbers

The objective is to find Numbers that can be divisible by all number between 0 to 10. The challenge is too make a code to get all those numbers between 0 and the input. Example:- Input :- 2570 output :- 2520 is a number divisible by 0-10. All languages is welcome.

13th Dec 2017, 10:38 AM
Akash Pal
Akash Pal - avatar
22 Answers
+ 19
All the multiples of 2520 are divisible by 1-10. So 2520, 5040, 7560, 10080, ... will be the output.
13th Dec 2017, 8:26 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 29
any number or notation like oo / 0 will be undefined & 0/0 will be indeterminant //here u will get number itself always as remainder when div. by 0 , so no need to check for 0 @ben,akash ☺
16th Dec 2017, 12:41 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 25
//here is my answer & challenge is correct now☺ import java.util.Scanner; class GauravProgram { public static void main (String args []){ int x=7*8*9*10,y=(new Scanner (System.in)).nextInt (); System.out.print (y%x==0?"yes":"no");} }
13th Dec 2017, 11:34 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 23
@rahul , u r right ... all int. b/w 0 & input will be answers (if input is not 0) , bcz all no. b/w input & 0 will be div. by 1 @akash the challenge is unclear , might u mean to output all integers which are divisible by all numbers(int.) b/w 0 to 10 & lie b/w 0 & input entered //in short , div. by lcm(1*2*3*4...*9) & lie b/w 0 & input //hope it helps☺
13th Dec 2017, 10:19 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
13th Dec 2017, 12:49 PM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
14th Dec 2017, 3:16 AM
qwerty
qwerty - avatar
+ 14
https://code.sololearn.com/cwONdUUROjrT/?ref=app
13th Dec 2017, 11:59 AM
LukArToDo
LukArToDo - avatar
13th Dec 2017, 6:40 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 10
Here my own answer hope you like it. https://code.sololearn.com/cIwFs8bOFHvL/?ref=app
14th Dec 2017, 5:12 AM
Akash Pal
Akash Pal - avatar
+ 6
@Eligijus I said that To get a number that can be divisible by 0,1,2,3,4,5,6,7,8,9,10.
13th Dec 2017, 8:16 AM
Akash Pal
Akash Pal - avatar
+ 6
@Akash here is my code: any recommend please stat ^.^ https://code.sololearn.com/cuAQmSbHFmw5/?ref=app
13th Dec 2017, 2:43 PM
Marcus Loh
Marcus Loh - avatar
+ 6
https://code.sololearn.com/cmr2kC1ZSTQL/?ref=app
13th Dec 2017, 7:30 PM
...
+ 5
@Rahul and @Gaurav I meant to say that a number which can be divisible by ,1,2,3,,4,5,6,7,8,9,10. I apologize for my mistake in the post. You can see it now.
13th Dec 2017, 10:37 AM
Akash Pal
Akash Pal - avatar
13th Dec 2017, 3:26 PM
Othmane Lh
Othmane Lh - avatar
+ 5
Yes, it ia allowed. Because the task is to get a number which get divide by all the numbers between 0-10.
16th Dec 2017, 12:25 PM
Akash Pal
Akash Pal - avatar
+ 4
Sorry I misread. Changed the code now to work correctly
13th Dec 2017, 8:26 AM
Eligijus Silkartas
Eligijus Silkartas - avatar
13th Dec 2017, 9:13 AM
Vishal Pal❄️⚛️
Vishal Pal❄️⚛️ - avatar
+ 4
heres my one line code.... prints lcm for 1 to n... default various inputs of n is already included.... https://code.sololearn.com/cY7MZPEKD4xD/?ref=app
13th Dec 2017, 2:37 PM
sayan chandra
sayan chandra - avatar
+ 4
Is it allowed to divide by zero?
16th Dec 2017, 3:21 AM
Ben Harp
Ben Harp - avatar
13th Dec 2017, 8:10 AM
Eligijus Silkartas
Eligijus Silkartas - avatar