I wrote this program to ask the user to give five numbers and then the program will compute the square and cube root value of the given five numbers using one-dimensional arrays using functions in C++ programming language.
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 in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.Program Listing
#include <iostream>
#include <iomanip>
using namespace std;
int square(int val[5])
{
cout << "\n\n";
cout << "Value" << setw(8) << "SQUARE"
<< setw(12) << "CUBE ROOT";
cout << "\n";
for (int v=0; v<5; v++){
cout <<"\n" <<setw(2) << v[val]
<< setw(8) << v[val] * v[val]
<< setw(12) << v[val] * v[val] * v[val];
}
}
main() {
int x[5];
cout << "\tSquare and Cube Root of the Number Using Functions in C++";
cout << "\n\n";
for (int list=0; list <5; list++) {
cout << "Enter a Number : " ;
cin >> list[x];
}
square(x);
cout << "\n\n";
system("PAUSE");
}
No comments:
Post a Comment