Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, September 2, 2019

Codecademy Built-In Methods 6/8


// Sample Solution
using System;

namespace LowestNumber
{
  class Program
  {
    static void Main(string[] args)
    {
      // Starting variables
      int numberOne = 12932;
      int numberTwo = -2828472;

      // Use built-in methods and save to variable
double numberOneSqrt = Math.Floor(Math.Sqrt(numberOne));

      // Use built-in methods and save to variable
double numberTwoSqrt = Math.Floor(Math.Sqrt(Math.Abs(numberTwo)));

      // Print the lowest number
Console.WriteLine(Math.Min(numberOneSqrt,numberTwoSqrt));

    }
  }
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts