In order for us to improve our programming skills we must always practice and solve different programming problems that we encounter in our day to day life. One of the most interesting problem that I encounter when I started write a program is how to create a multiplication table using C++ programming language as my primary language. Maybe some people think my problem is very easy and very basic but for me even a simple problem has a place for me in improving my skills and understanding how to create good algorithm to derive a solution to the problem.
I started using nested for loop statement to generate the multiplication values by multiplying the values of variable x and y. I also use the C++ library called iomanip or its stands for input and output manipulator to give spacing of values in our program. The code is very short and very easy to understand I intended my work for beginners in C++ programming I hope they will find my work useful.
If you have some questions about my works feel free to send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.
Thank you very much.
Sample Output of Our Program
Zip File Content of Our Program
Program Listing
#include <iostream>
#include <iomanip>
using namespace std;
main()
{
cout << "\t Multiplication Table";
cout << "\n\n";
for (int x=1; x!=11; x=x+1) {
cout << "\n";
for (int y=1; y<=10; y++) {
cout << setw(4) << x*y;
}
}
cout << "\n\n";
}
No comments:
Post a Comment