Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Binomial Coefficient in java
Binomial coefficient (c(n, r) or nCr) is calculated using the formula n!/r!*(n-r)!. Following is the Java program find out the binomial coefficient of given integers.Programimport java.util.Scanner; public class BinomialCoefficient { public static long fact(int i) { if(i
Read MoreMultiplicative order in java
Following is a Java program which prints the multiplicative order of given numbers.import java.util.Scanner;Programpublic class MultiplicativeOrder { public static int gcd(int num1, int num2) { if (num2 != 0) { return gcd(num2, num1 % num2); } else { return num1; } } static int multiplicativeOrder(int num1, int num2) { if (gcd(num1, num2) != 1) { return -1; } int res = 1; int p ...
Read MoreCatalan numbers in java
The nth Catalan number in terms of binomial coefficients is calculated by the formula(n + k )/k where k varies from 2 to n and n ≥ 0. i.e.Cn = (2n)!/((n+1)!n!)Programpublic class CatalanNumbers { public static long fact(int i) { if(i
Read MoreSmith Numbers in java
A composite number whose sum of digits equal to the sum of the digits of its prime factors.Ex: 58 = 2 x 29 (5 + 8 = 12) (2+ 2 + 9 = 12)Programpublic class SmithNumbers { public static boolean isPrime(int number) { int loop; int prime = 1; for(loop = 2; loop < number; loop++) { if((number % loop) == 0) { prime = 0; } } if (prime ...
Read Morek-th prime factor of a given number in java
Following is the Java program which prints the kth prime factor of a number n, when k and n are given.Programimport java.util.Scanner; public class KthPrimeFactor { public static void main(String args[]) { int number, k, factor = 0; Scanner sc = new Scanner(System.in); System.out.println("Enter a number :"); number = sc.nextInt(); System.out.println("Enter the k value :"); k = sc.nextInt(); int temp = k-1; for(int i = 2; i< number; ...
Read MoreWhat is the easiest way to transfer files from phone to PC?
This question occurs in our minds when we have to transfer files and all old methods start giving us enough troubles. The one way is to synchronize your phone with the USB cable, but you cannot carry the cable everywhere. You can transfer your data through email or other conventional methods, but again these tricks come with a lot of mess. However, you can get this done through some easy tools mentioned here:Push BulletYou can connect your phone and PC completely with the help of this tool, which also gives you a feeling that both your device and PC are ...
Read MoreFind politeness of a number in java
The numbers which can be expressed as the sum of positive consecutive integers are known as polite numbers.Ex: 5 = 2+3The number of ways a number can be expressed as the sum of positive integers will be the Politeness of that number.Ex: 9 = 4+5 || 2+3+4AlgorithmGet the prime factors of a number.Get the powers of prime factors greater than 2.Add 1 to all of them.Multiply them, subtract 1 from the result.Programimport java.util.Scanner; public class PolitenessOfANumber { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter a number"); ...
Read MoreFind all divisors of a natural number in java
Following is the Java program which prints all the divisors of a given number.Programimport java.util.Scanner; public class DivisorsOfNaturalNumber { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter required number :"); int num = sc.nextInt(); for(int i = 1; i
Read MoreWhat are some helpful English phrases that can improve my English?
A language can be easily learned by attempting the use of the things you see around, especially the phrases, which can help you improve your written as well as spoken English. The following Idioms belong to the word 'Blue’. Take a look!Blue-Sky (Fictitious)Usage − Blue sky thinking will yield nothing.Bluestocking (A Wise and Educated Lady)Usage − A bluestocking like her is not approved of by some men.Make Me Blue(Depressed, Melancholy)Usage − That music always makes me blue.Blue Jokes(Obscene, Vulgar, Dirty.)Those blue jokes don’t go over very well around here.Out of the Blue(The Sky, The Heavens)The idea came to me right out ...
Read MoreWhat is the most interesting thing you have come across today?
I am a huge movie-buff and digging out casual info about cinema and celebrities is something I love to do in my leisure. Today, as soon as I hit my phone in a casual mood, and googled how Kamal Hasan’s latest release is doing at the box office, I clapped eyes on a very interesting fact, which will be easy for you to understand after checking out this image.Now, you see right below the name Kamal Haasan, Indian Politician is mentioned. I don’t know but this fell on me as a sheer surprise. Many folks including me consider him (and ...
Read More