What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-17 15:16:15
generate all prime number less than n java (fastest method)
/** Author: Jeffrey Huang As far as I know this is almost the fastest method in java for generating prime numbers less than n. A way to make it faster would be to implement Math.sqrt(i) instead of i/2. I don't know if you could implement sieve of eratos... Add solution -
Java 2021-11-16 10:50:14
Write a program that prints the next 20 leap years.
public class Main { public static void main(String[] args) { var scanner = new java.util.Scanner(System.in); System.out.print("What is the current year? "); int year = scanner.nextInt() + 1; int count = 0; while (count <... Add solution -
Python 2021-11-15 20:13:20
form a chakravyuh matrix python
num=int(input("enter the length of square matrix")) n_list=[[0 for x in range(num)] for y in range(num)] n=1 low=0 high=num - 1 count=int((num+1)/2) for i in range(count): for j in range(low,high+1): n_list[i][j]=n n+=1 ... Add solution -
Other 2021-11-14 18:29:13
how does math.rint work
The Java Math rint() method returns a value that is closest to the specified value and is equal to the mathematical integer. That is, if the specified value is 5.8, the closest value that is equal to the mathematical integer is 6.0. And, for value 5.4, th... Add solution
Best helpers
Ranking is empty