Thread: Radius formula help

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    33

    Radius formula help

    to get radius is = squareroot area / pie
    the heck do i get squareroot?
    what is the secret formula for squareroot?
    Code:
    #include<stdio.h>
    #include<conio.h>
    main()
    {
        clrscr();
        int area;
        float r;
        printf("\nEnter area of the circle:");
        scanf("%d",&area);
        r = 3.14/area;
        printf("\nThe radius of the circle is %f",r);
        getch();
        return(0);
    }
    Last edited by langamer101; 12-17-2011 at 10:06 AM.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    LOL ^^^

    #include <math.h>

    and use double variable = sqrt(double N), where N is the number you want the square root of.

    Your compiler may support float variable = sqrtf(float N), so check it.

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    33
    thank you very much Adak. I got confused with what squareroot formula is but there wasn't any, thanks man.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help on formula?
    By Radox in forum C Programming
    Replies: 3
    Last Post: 03-04-2011, 09:14 PM
  2. Backdooring Instantaneous Radius of Curvature & Functions
    By just2peachy in forum C++ Programming
    Replies: 8
    Last Post: 10-06-2004, 12:25 PM
  3. formula
    By pete in forum C++ Programming
    Replies: 7
    Last Post: 05-26-2003, 08:32 PM
  4. help with writing function that multiplys the radius
    By Earl Lee in forum C Programming
    Replies: 6
    Last Post: 10-03-2002, 04:33 PM
  5. ok radius
    By abbynormal87 in forum C++ Programming
    Replies: 8
    Last Post: 05-02-2002, 02:15 AM