the circumference of the square

This is a discussion on the circumference of the square within the C++ Programming forums, part of the General Programming Boards category; 1- Write C++ program that compute the circumference of the square in this drawn shape. The program asks the user ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    3

    Exclamation the circumference of the square

    1- Write C++ program that compute the circumference of the square in this drawn shape. The program asks the user to enter the area of the circle.

    http://aycu16.webshots.com/image/117...3838156_fs.jpg

    Note: that the input must entered in meter and then the circumference should be displayed in centimeter.

  2. #2
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    Last edited by Brad0407; 04-06-2007 at 08:50 AM.
    Don't quote me on that... ...seriously

  3. #3
    Lean Mean Coding Machine KONI's Avatar
    Join Date
    Mar 2007
    Location
    Luxembourg, Europe
    Posts
    444
    1. Area of the circle: A = Pi * (r*r)
    2. Side of the square: L = 2*r
    3. Circumference of the square: C = 4*L

    that's pretty much everything you'll ever get from this forum if you don't post your own code.

    btw:

    C = 4*L = 4*2*r = 8*r = 8 * sqrt(A / Pi)

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,295
    Quote Originally Posted by tootoo View Post
    Write C++ program ...
    No!

    This is a place to ask questions, not give imperative statements.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe Comp Move help
    By swgh in forum C++ Programming
    Replies: 5
    Last Post: 09-24-2008, 11:05 AM
  2. Loop seg error
    By Zishaan in forum Game Programming
    Replies: 2
    Last Post: 03-28-2007, 01:27 PM
  3. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 06:57 PM
  4. Help with my draughts game
    By Zishaan in forum C++ Programming
    Replies: 9
    Last Post: 03-24-2007, 07:33 AM
  5. C++ Checkers Game
    By SnS CEO in forum C++ Programming
    Replies: 9
    Last Post: 09-07-2005, 01:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21