Post: [C++] multiplication table program [C++]
12-01-2011, 03:23 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); this program is just a simple little neat program that allows you to make multiplication tables


i will post the source code just compile using your desired compiler

    
#include <iostream>
#include <windows.h>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
system("cls");
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
system("cls");
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


Linux code:
    
#include <iostream>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


it's a really simple program, but the other day i started windows gui programming in c++ so i decided to post some of my older programs this was a neat one.
Last edited by Docko412 ; 01-24-2012 at 11:34 PM.
12-05-2011, 06:22 AM #2
Pichu
RIP PICHU.
Originally posted by Docko412 View Post
this program is just a simple little neat program that allows you to make multiplication tables


i will post the source code just compile using your desired compiler

    
#include <iostream>
#include <windows.h>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
system("cls");
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
system("cls");
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


it's a really simple program, but the other day i started windows gui programming in c++ so i decided to post some of my older programs this was a neat one.


Looks nice, I'm still in C#, I'm not going to move over to C# due to the fact of XNA, although since I am learning to code in Java and will, when I am better, make my own game in Java I may move to C++ for application development instead of using C#. Smile

Still not sure yet.

The following user thanked Pichu for this useful post:

tylerallmighty
12-09-2011, 04:03 PM #3
MasterBaitor
< ^ > < ^ >
Originally posted by Docko412 View Post
this program is just a simple little neat program that allows you to make multiplication tables


i will post the source code just compile using your desired compiler

    
#include <iostream>
#include <windows.h>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
system("cls");
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
system("cls");
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


it's a really simple program, but the other day i started windows gui programming in c++ so i decided to post some of my older programs this was a neat one.


Seems pretty good nice :y: I just started learining C++ myself Cool Man (aka Tustin)

The following user thanked MasterBaitor for this useful post:

Docko412
01-24-2012, 05:17 PM #4
tylerallmighty
Human After All
Originally posted by Sublimity View Post
Looks nice, I'm still in C#, I'm not going to move over to C# due to the fact of XNA, although since I am learning to code in Java and will, when I am better, make my own game in Java I may move to C++ for application development instead of using C#. Smile

Still not sure yet.


:lol: We're doing the exact same thing.
01-24-2012, 05:52 PM #5
DlBSY993
There's 0nly 1..
Originally posted by Docko412 View Post
this program is just a simple little neat program that allows you to make multiplication tables


i will post the source code just compile using your desired compiler

    
#include <iostream>
#include <windows.h>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
system("cls");
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
system("cls");
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


it's a really simple program, but the other day i started windows gui programming in c++ so i decided to post some of my older programs this was a neat one.


Rather than just modifying code i want to learn to prgram ... with C++ where would you recommend i start? and nice srcipt Winky Winky

The following user thanked DlBSY993 for this useful post:

Docko412
01-24-2012, 11:29 PM #6
Originally posted by DlBSY993 View Post
Rather than just modifying code i want to learn to prgram ... with C++ where would you recommend i start? and nice srcipt Winky Winky


if you want to learn to program c++ go to You must login or register to view this content. read it all the way through step by step do everything it tells you don't just skim then you should have a basic understanding of what it does. then move on up to a basic gui programming once you feel confident enough to do so.

The following user thanked Docko412 for this useful post:

DlBSY993
01-24-2012, 11:35 PM #7
DlBSY993
There's 0nly 1..
Originally posted by Docko412 View Post
if you want to learn to program c++ go to You must login or register to view this content. read it all the way through step by step do everything it tells you don't just skim then you should have a basic understanding of what it does. then move on up to a basic gui programming once you feel confident enough to do so.


thanks alot man Smile
02-05-2012, 04:16 PM #8
Can you explain to me why the table format is changed by the if structures?

The way I'm looking at it, if(x*y<=99)cout<<" "; and if(x*y<=9)cout<<" "; should display the same thing. What am I missing? Do you know of a good resource to pick up on the use of tables like this?

Thanks.
02-06-2012, 11:31 AM #9
Originally posted by Indiana
Can you explain to me why the table format is changed by the if structures?

The way I'm looking at it, if(x*y<=99)cout<<" "; and if(x*y<=9)cout<<" "; should display the same thing. What am I missing? Do you know of a good resource to pick up on the use of tables like this?

Thanks.


what do you mean by display the same thing?

---------- Post added at 07:31 AM ---------- Previous post was at 07:15 AM ----------

Originally posted by Indiana
Can you explain to me why the table format is changed by the if structures?

The way I'm looking at it, if(x*y<=99)cout<<" "; and if(x*y<=9)cout<<" "; should display the same thing. What am I missing? Do you know of a good resource to pick up on the use of tables like this?

Thanks.


also, the if statements are just what makes the table display parallel
without them it will display like this
    
1 2 3 4 5 6 7 8 9 10

2 4 6 8 10 12 14 16 18 20

3 6 9 12 15 18 21 24 27 30

4 8 12 16 20 24 28 32 36 40

5 10 15 20 25 30 35 40 45 50

6 12 18 24 30 36 42 48 54 60

7 14 21 28 35 42 49 56 63 70

8 16 24 32 40 48 56 64 72 80

9 18 27 36 45 54 63 72 81 90

10 20 30 40 50 60 70 80 90 100


as opposed to with them they will display
    
1 2 3 4 5 6 7 8 9 10

2 4 6 8 10 12 14 16 18 20

3 6 9 12 15 18 21 24 27 30

4 8 12 16 20 24 28 32 36 40

5 10 15 20 25 30 35 40 45 50

6 12 18 24 30 36 42 48 54 60

7 14 21 28 35 42 49 56 63 70

8 16 24 32 40 48 56 64 72 80

9 18 27 36 45 54 63 72 81 90

10 20 30 40 50 60 70 80 90 100

02-06-2012, 08:54 PM #10
|C++|
< ^ > < ^ >
Originally posted by Docko412 View Post
this program is just a simple little neat program that allows you to make multiplication tables


i will post the source code just compile using your desired compiler

    
#include <iostream>
#include <windows.h>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
system("cls");
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
system("cls");
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


Linux code:
    
#include <iostream>

using namespace std;
int main(){
for(;Winky Winky{
int X,Y;
cout<<"enter number:";
cin>>X;
cout<<"enter number:";
cin>>Y;
for(int y = 1; y <= Y; y++)
{
cout<<" ";
for(int x = 1; x <= X; x++)
{
cout<<x*y<<" ";
if(x*y<=99)cout<<" ";
if(x*y<=9)cout<<" ";
}
cout<<endl<<endl;
}
}
return 0;

}


it's a really simple program, but the other day i started windows gui programming in c++ so i decided to post some of my older programs this was a neat one.


doesnt work bro

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo