Saturday, March 14, 2015

Simple Multiplication Table in C++

Here a simple multiplication table in C++ that I wrote a very long time ago using for loop statements and built in library in C++. I hope beginners in C++ programming find my work useful and beneficial in their school assignments and projects.

If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com. People here in the Philippines who wish to contact me can reach me at my mobile number 09173084360




Sample Program Output 

Program Listing

#include <cstdlib>
#include <iostream>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[])
{
    int values[10] = {1,2,3,4,5,6,7,8,9,10};
    int values2[10] = {10,9,8,7,6,5,4,3,2,1};

     cout << "\n\n";
     cout << " ===== SIMPLE MULTIPLICATION TABLE =====";
     cout << "\n\n Created By: Mr. Jake R.Pomperada,MAED-IT";
     cout << "\n\n";

    for (int list=0; list <10 ; list++) {
        cout << "\n";
        cout<< setw(2) << list[values] << " x " <<
             setw(2) << list[values] << " = " <<
             setw(2) << list[values] * list[values];


        cout<< setw(10) << list[values] << " + "  <<
             setw(2) << list[values2] << " = " <<
             setw(1) << (list[values] + list[values2]);

        }
        cout << "\n\n";
    system("PAUSE");
    return EXIT_SUCCESS;
}




 

No comments:

Post a Comment