Thursday, May 27, 2021

Square and Cube Root in C++

 A simple program to display a square and cube root numerical values in C++ programming languages.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing


// square_cube_root.cpp

// Jake Rodriguez Pomperada,MAED-IT, MIT

// www.jakerpomperada.com   www.jakerpomperada.blogspot.com

// jakerpomperada@gmail.com


#include <iostream>

#include <iomanip>


using namespace std;


int main(int argc, char *argv[])

{

   int val[4][2] = {1,2,3,4,5,6,7,8};

    cout <<"\n\n";

    cout << "\tSquare and Cube Root in C++";

    cout <<"\n\n";

    cout << "NUMBER" <<

         setw(10) << "SQUARE"  <<

         setw(13) << "CUBE ROOT";

   for (int row=0; row < 4; row++) 

      for (int col=0; col < 2; col++)

   {

     cout <<"\n" << setw(2) << val[row][col] 

          << setw(12) << val[row][col]  *

          val[row][col] << setw(10) <<

           val[row][col]  *  val[row][col] *

        val[row][col]; 

           }

   cout << "\n\n";

   cout <<"\tEnd of Program";

   cout << "\n\n";

    system("PAUSE");

    

}


No comments:

Post a Comment