beginner-volume of shere

This is a discussion on beginner-volume of shere within the C Programming forums, part of the General Programming Boards category; Write a program that computes the volume of a sphere with a 10meter radius, using the formula v = 4/3лr3. ...

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    3

    Unhappy beginner-volume of shere

    Write a program that computes the volume of a sphere with a 10meter
    radius, using the formula
    v = 4/3лr3.
    can anyone give me the answer?please

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    No.
    Post the code(in code tag) that you have problem with.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    3
    i can't undestand the solution.....

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    3
    Code:
    #include <stdio.h>
    
    #define pi 3.14
    
    main()
    {
          double radius, volume;
          printf("radius=10\n");
          scanf("%f", &radius);
          volume=(4.0/3.0)*pi*(radius, 3);
          printresults();
          system("pause");
    }

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,981
    (radius, 3) should be pow(radius, 3). Oh, and you should #include <math.h> for the pow function... or simply write radius * radius * radius.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    And correct format specifier for double(in scanf()) is %lf not %f.
    Last edited by Bayint Naung; 08-22-2010 at 09:52 AM. Reason: ...

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    250

    Me is beginnerz too!!!!!!1111!!!111

    Write a program that converts the following sentence into english: "M3 r l4zE & r3tard3D!"

    Plees gimme anser!!
    iMalc: Your compiler doesn't accept misspellings and bad syntax, so why should we?
    justin777: I have no idea what you are talking about sorry, I use a laptop and there is no ascii eject or something

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 44
    Last Post: 03-19-2010, 04:06 PM
  2. Detect the Audio And Microphone Level In Windows
    By Kelderic in forum C Programming
    Replies: 6
    Last Post: 11-17-2009, 11:21 PM
  3. Volume of a Cone Equation always equals 0
    By Devolution in forum C Programming
    Replies: 11
    Last Post: 01-28-2009, 02:13 AM
  4. Help! Right Math, Wrong Output
    By verd in forum C Programming
    Replies: 12
    Last Post: 03-15-2005, 06:49 PM
  5. What am I doing wrong? Help please...
    By SprinterSteve in forum C Programming
    Replies: 9
    Last Post: 04-17-2003, 09:35 PM

Tags for this Thread


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