Java Program to Check for Right Angled Triangle | HackerNoon

Österreich Nachrichten Nachrichten

Java Program to Check for Right Angled Triangle | HackerNoon
Österreich Neuesten Nachrichten,Österreich Schlagzeilen
  • 📰 hackernoon
  • ⏱ Reading Time:
  • 60 sec. here
  • 2 min. at publisher
  • 📊 Quality Score:
  • News: 27%
  • Publisher: 51%

A simple program in Java to check whether a triangle is right-angled or not. - cc: MayankVikash1 java learningtocode

A right-angled triangle is a triangle with one of its interior angles equal to 90 degrees or any one angle is a right angle.

There are several properties of a right-angled triangle; one of them is that the square of the hypotenuse is equal to the sum of the square of the perpendicular and base of a triangle. This is called the Pythagoras Theorem.Fun Fact: Pythagoras’s Theorem was invented in India, long before Pythagoras was even born.

The theorem is mentioned in the Baudhayana Sulba-sutra of India, which was written between 800 and 400 BCE.According to the theorem, the squared of Hypotenuse is equal to the sum of the squared of the other two sides. So, we have to take the input of the two sides of a triangle and a hypotenuse. Calculate the sum of squares of the other two sides and if the sum is equal to the square of the hypotenuse, the triangle is right-angled.import java.

The simple way to check if the squared of the hypotenuse is equal to the sum of the squared of the perpendicular and base is to use if-else.import java.util.*; public class RightAngledTriangle { public static void main { Scanner in=new Scanner; int h, p, b; System.out.println; h=in.nextInt; System.out.println; p=in.nextInt; System.out.println; b=in.nextInt; if +){ System.out.println; } else{ System.out.

Wir haben diese Nachrichten zusammengefasst, damit Sie sie schnell lesen können. Wenn Sie sich für die Nachrichten interessieren, können Sie den vollständigen Text hier lesen. Weiterlesen:

hackernoon /  🏆 532. in US

Österreich Neuesten Nachrichten, Österreich Schlagzeilen

Similar News:Sie können auch ähnliche Nachrichten wie diese lesen, die wir aus anderen Nachrichtenquellen gesammelt haben.

Cosmological Difficulties of Newton's Theory | HackerNoonCosmological Difficulties of Newton's Theory | HackerNoonRelativity: The Special and General Theory by Albert Einstein is part of HackerNoon’s Book Blog Post series. - science physics
Weiterlesen »

Natural Selection | HackerNoonNatural Selection | HackerNoonOn the Origin of Species 1st Edition by Charles Darwin is part of HackerNoon’s Book Blog Post series. - science biology
Weiterlesen »

The Solution of the Problem of Gravitation | HackerNoonThe Solution of the Problem of Gravitation | HackerNoonRelativity: The Special and General Theory by Albert Einstein is part of HackerNoon’s Book Blog Post series. - science physics
Weiterlesen »



Render Time: 2025-03-10 21:31:12