is Pythagorean Triplet - CSharp System

CSharp examples for System:Math Number

Description

is Pythagorean Triplet

Demo Code


using System;/*from w w w  .  jav  a  2s.  co  m*/

public class Main{
    public static bool isPythagoreanTriplet(int a, int b, int c) {
         if (Math.Pow(a, 2) + Math.Pow(b, 2) == Math.Pow(c, 2)) {
            return true;
         }

         return false;
      }
}

Related Tutorials