Results 1 to 6 of 6

Thread: Square Root Symbol In Java

  1. #1
    Join Date
    Nov 2009
    Posts
    877

    Square Root Symbol In Java

    Hello, I am currently creating a small program in the java. And while creating the program which can simply take square root of the number provided by you. But my problem is I want to simply provide the square root symbol on the command prompt in java while asking the user about it. If anyone know how to perform it then please provide me help regarding it.

  2. #2
    Join Date
    May 2008
    Posts
    97

    Re: Square Root Symbol In Java

    Hello, I am not having knowledge in programming but, I think if you want to make use of the Square Root Symbol in java, then you may need to follow the steps below:
    • Click on start.
    • Now click on Run.
    • Type the command as "charmap"
    • Now just search for the Square root symbol in the window which is opened.
    • Make use of the symbol.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: Square Root Symbol In Java

    It is quiet simple to make use of the Square root symbol in java and you will able to get it. It will simply make use of the ASCII value of it.
    Code:
    public class Squreroot
    {
     public static void main(String[]args)
     {
      System.out.println("\u221A");
     }
    }

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Square Root Symbol In Java

    If you want to Squre root the number in java then you must make use of the code below. But, if you want to make use of the Square Root Symbol then, I don't think it will be possible in java.
    Code:
    public class SquareRoot
    {
    public static void main(String[] args) 
    {
    System.out.println(Math.sqrt(25));
    System.out.println(Math.sqrt(255));
    }
    }

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Square Root Symbol In Java

    Hello, I have checked on internet and then I come to know that if you want to use any type of symbol in your java code then you simply make use of the Ascii code of that particular symbol. So, just make use of it and you will able to solve your problem. You can get the ascii values from internet and make use of it for your use.

  6. #6
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Square Root Symbol In Java

    I have got the code which can simply help you to provide the Squre root symbol in the JOptionPane's message box. It will help you to get the solution.
    Code:
    import javax.swing.JOptionPane;
    public class Testing 
    {
    public static void main(String[]args)
    {
    JOptionPane.showMessageDialog(null,"\u221A");
    }
    }

Similar Threads

  1. Replies: 5
    Last Post: 07-06-2010, 10:47 PM
  2. How can I find square root using c program?
    By ScarFace 01 in forum Software Development
    Replies: 5
    Last Post: 06-01-2010, 02:16 PM
  3. Error in Java file: Cannot find symbol
    By Jayden in forum Software Development
    Replies: 5
    Last Post: 02-09-2009, 08:48 AM
  4. Java 11 cannot find symbol
    By Wyvern in forum Software Development
    Replies: 3
    Last Post: 02-09-2009, 01:12 AM
  5. Square root and Visual C++ compiler
    By Luis234 in forum Software Development
    Replies: 4
    Last Post: 25-04-2009, 12:02 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,168,692.31036 seconds with 17 queries