Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Yahoo!

  • 3 years ago

write a c++ prgm to find the cube of given number

  • This Question is Closed
  1. A.Avinash_Goutham
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    #include<iostream.h> #include<conio.h> void main() { clrscr(); //to clear screen float cube(float); //function prototype float a,cu; cout<<"Enter any number:"; cin>>a; cu=cube(a); //function calling cout<<"\nCube of "<<a<<" is "<<cu; getch(); } float cube(float a) { float cu; cu=a*a*a; return(cu); } sry i donno c++ so jus copied the code -.-

  2. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    oh...i want this in simple language

  3. mathslover
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @A.Avinash_Goutham Please provide the link also .. -_-

  4. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    not by using float

  5. A.Avinash_Goutham
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    -.- printf("enter the number:"); scanf("%f",&x); x=x*x*x; printf("the cube of number %f",x);

  6. A.Avinash_Goutham
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    replace %f with %d nd float with int

  7. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    #include <iostream> using namespace std; int main() { int value, cube; cin >> value; cube = value*value*value; cout << cube; return 0; }

  8. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    help me to do this in simple manner

  9. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @nick67 can u write by giving the values

  10. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    what do you mean ?

  11. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    cube = value*value*value; give some value

  12. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    value is entered with "cin >> value" from the user

  13. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    return 0; wat is this

  14. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    At the end of a function (in this case the "main" function) you use a return to exit the function; in this case the value is returned to the program caller, i.e. the O.S. Usually a program without errors returns 0

  15. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @nick67 do u have c++ V 3.5

  16. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    or any version of c++

  17. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @nick67

  18. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Can u send me that or plzz provide a link to download it ..)))

  19. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    I use Eclipse with C++ on Linux

  20. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    u have LINUX.................oh....no i am on WiNDOWS 7

  21. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    try this: http://www.bloodshed.net/devcpp.html it's a bit old but works

  22. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thxxx

  23. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    for students I strongly suggest to switch to GCC compiler as soon as possible

  24. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    is this same as Borland C++

  25. Yahoo!
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @nick67

  26. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    I don't know, because I don't use Borland anymore, but give a chance to the GNU/Linux world :-)

  27. nick67
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 3

    and as IDE take into consideration Eclipse framework; it's very flexible and let you to do many things http://www.eclipse.org

  28. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy