pupesko

SoftUni - 2.8 Square Root

Oct 26th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. //Create a console application that calculates and prints the square root of the number 12345.
  2.  
  3. using System;
  4.  
  5. namespace SquareRoot
  6. {
  7.     class Program
  8.     {
  9.         static void Main()
  10.         {
  11.             Console.Write("Enter number: ");
  12.             int number = Convert.ToInt32(Console.ReadLine());
  13.  
  14.             Console.Write("The squareroot of " + number + " is: ");
  15.             Console.WriteLine(Math.Sqrt(number).ToString());        
  16.    
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment