Saturday, September 3, 2016

Cube Root in C++

A simple program that I wrote in C++ to show how to solve cube root. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler.


Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
 
My mobile number here in the Philippines is 09173084360
.


Program Listing

#include <iostream>
#include <iomanip>

using namespace std;

struct cube{

  int value;

  int solve()
    {
        return(value * value * value);
    }
  };

  main() {

       cube val;

      cout << "\t\t Cube Root Solver 1.0";
      cout << "\n\n";
      cout << "Enter a Number : ";
      cin >> val.value;
      cout << "\n";
      cout << "The Cube Root Value of " << val.value
           << " is " << val.solve() << ".";
     cout << "\n\n";
     system("pause");
  }


No comments:

Post a Comment