Found 2616 Articles for Java

How To Check Whether a Number is an Empire Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:04:04

221 Views

A number is said to be an empire number, if after reversing a prime number we get another prime number. In this article, we will see how to check if a number is an empire number by using Java programming language. To show you some instances Instance-1 Input number is 13. Let’s check it by using the logic of the Empire number. 13 is a prime number. If we reverse 13, then we get = 31 As we notice here both the reversed number and input number both are prime numbers. Hence, 13 is an empire number. Instance-2 ... Read More

How To Get the Arc Length from Given Angle in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 12:19:58

353 Views

Arc length refers to the length between two points along the arc (two points along a section of a circle or curve). Simply it is a part of the circumference of the circle. When two lines intersect each other, the common meeting point is called a vertex and the geometrical figure between the two arms/lines is called an angle. As per the problem statement, there is a circle and you have the angle from which you need to find out arc length. Formula to find the arc length by using diameter − Arc Length = (Θ / 360) * (d ... Read More

How To Find Volume of Hemisphere in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 12:11:57

400 Views

A hemisphere refers to the exact half of a sphere. Means if we divide a sphere in two equal parts then we will get two hemispheres. Hemisphere is a three-dimensional geometrical shape which has one flat face. The amount of space occupied by the hemisphere is called the volume of the hemisphere. Formula to calculate volume of hemisphere − Mathematically it can be represented as $$\mathrm{Volume \:=\: (2\pi\:r^2)/3}$$ Mathematically it can be represented as Volume = (2 * pi * r * r) / 3 Where, ‘r’ refers to the radius of the hemisphere. In this article we will ... Read More

How To Find the Length of Hypotenuse in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 12:02:39

1K+ Views

Hypotenuse refers to the longest side which is opposite to the right angle of a right-angled triangle. The length of the hypotenuse can be found using Pythagorean theorem. According to Pythagoras theorem, sum of square of length of two sides is equal to the of square of length of third side i.e, a2+ b2 = c2Where, a, b and c refer to the three sides of the right-angled triangle. So, Hypotenuse = Math.sqrt(Math.pow(base, 2) + Math.pow(height, 2)) In this article, we will see how we can find the length of hypotenuse by using Java programming language. To show you ... Read More

How To Find the Surface Area of Hemisphere in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:55:07

217 Views

A hemisphere refers to the exact half of a sphere. Means if we divide a sphere in two equal parts then we will get two hemispheres. Hemisphere is a three-dimensional geometrical shape which has one flat face. There are many practical examples of hemispheres. The earth divided into 2 equal parts results 2 hemispheres i.e. Northern hemisphere and Southern hemisphere. The area occupied by the outer surface of a three-dimensional object is called the surface area. Formula to calculate surface area of hemisphere − Mathematically it can be represented as $$\mathrm{Surface \:Area \:= \:2\pi\:r^2}$$ Mathematically it can be represented as ... Read More

How To Check Whether a Number is an Ugly Number or Not in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:46:33

779 Views

A number is said to be an ugly number, if the prime factors of that input number only include 2, 3 and 5. Maybe some number has some prime factors which have only one factor or two factors but those factors must be one of 2, 3, and 5. In this article we will see how to check if a number is an Ugly number or not by using Java programming language. To show you some instances Instance-1 Input number is 20. Let’s check it by using the logic of Ugly number. Prime factors of 20 = 2, 2, 5 ... Read More

How To Check Whether a Number is a Strong Number or Not in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:43:09

14K+ Views

A number is said to be a Strong number, if the sum of factorials of the input number’s every digit is equal to the same input number. For more clarification, we have to find the factorial of every digit of the given number. After that we have to calculate the sum of those factorials. Then we have to compare both the sum value and input number, if they are same then the given number is a strong number otherwise it is not a strong number. In this article, we will see how to check if a number is a strong ... Read More

How To Check Whether a Number is a Spy Number or Not in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:35:11

2K+ Views

A number is said to be a Spy number, if the sum of the digits of the given number is equal to the product of the digits of the given number. For more clarification, we have to first calculate the sum of the digits of the given number. After that we have to calculate the product of the digits of the given number. Then we have to compare both the sum value and product value, if they are the same then the given number is a spy number otherwise it is not a spy number. In this article, we will ... Read More

How To Check Whether a Number is a Special Number or Not in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:31:24

4K+ Views

A number is said to be a Special number, if the sum of factorials of the input number’s every digit is equal to the same input number. For more clarification, we have to find all the factors of every digit of the given number. After that we have to calculate the sum of those factorials. Then we have to compare both the sum value and input number, if they are the same then the given number is a special number otherwise it is not a special number. In this article, we will see how to check if a number is ... Read More

How To Check Whether a Number is a Goldbach Number or Not in Java?

Mr. Satyabrata
Updated on 17-Nov-2022 11:20:04

2K+ Views

A number is said to be a Goldbach number, if the number can be expressed as the addition of two odd prime number pairs. If we follow the above condition, then we can find that every even number larger than 4 is a Goldbach number because it must have any pair of odd prime number pairs. But the odd numbers are not satisfying because we know the addition of two numbers can never be an odd number. In this article, we will see how to check if a number is a Goldbach number by using Java programming language. To show ... Read More

Advertisements