+ 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.
22 Answers
+ 19
All the multiples of 2520 are divisible by 1-10.
So 2520, 5040, 7560, 10080, ... will be the output.
+ 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 ☺
+ 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");}
}
+ 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☺
+ 17
Using inline assembly:
https://code.sololearn.com/c956UVpNmuhM/?ref=app
+ 14
https://code.sololearn.com/cwONdUUROjrT/?ref=app
+ 13
Here's my Python code:
https://code.sololearn.com/cqt5HtU1jAoW/?ref=app
+ 10
Here my own answer hope you like it.
https://code.sololearn.com/cIwFs8bOFHvL/?ref=app
+ 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.
+ 6
@Akash here is my code:
any recommend please stat ^.^
https://code.sololearn.com/cuAQmSbHFmw5/?ref=app
+ 6
https://code.sololearn.com/cmr2kC1ZSTQL/?ref=app
+ 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.
+ 5
Yes, it ia allowed. Because the task is to get a number which get divide by all the numbers between 0-10.
+ 4
Sorry I misread. Changed the code now to work correctly
+ 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
+ 4
Is it allowed to divide by zero?