Advertisement
AnitaN

01.Intro-Programming-Homework/08.Square-Root

Mar 9th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. //Problem 8. Square Root
  2. //Create a console application that calculates and prints the square root of the number 12345. Find in Internet “how to calculate square root in C#”.
  3.  
  4. using System;
  5.  
  6. class SquareRoot
  7. {
  8.     static void Main()
  9.     {
  10.         int number = 12345;
  11.         //Square root of the number
  12.         double squareNumber = Math.Sqrt(number);
  13.         //Print result to console.
  14.         Console.WriteLine("Square root of Number {0} is {1}.",number,squareNumber);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement