Write a php program to print prime numbers between 1 to N. In this tutorial, we are going to use Sieve of Eratosthenes algorithm to print prime numbers between 1 to N.
-
Related Posts (YARPP)
-
Topics
-
-
Write a php program to print prime numbers between 1 to N. In this tutorial, we are going to use Sieve of Eratosthenes algorithm to print prime numbers between 1 to N.
Write a java program to find common elements in three sorted arrays.
Given three sorted arrays, write a code to print intersection of three sorted arrays.
For example –
arr1 = {1, 5, 10, 20, 40, 80};
arr2 = {6, 7, 20, 80, 100};
arr3 = {3, 4, 15, 20, 30, 70, 80, 120};
Output : {20, 80}
20 and 80 are the common elements in 3 arrays. These two elements are the intersection of 3 sorted arrays.
Write a java program to find sum of digits of a number. Given an input number, we have to write a java code to calculate sum of digits of a number.
For example –
i)
Input : 256
Output : 13 (2+5+60
ii)
Input : 15
Output : 6 (1+5)