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.
02-07-2012, 06:33 AM #11
Originally posted by SLiiTH3R View Post
doesnt work bro


how? what are you using to compile it with?
it's worked fine for everyone else.
02-07-2012, 06:34 AM #12
Originally posted by SLiiTH3R View Post
doesnt work bro


how? what are you using to compile it with?
it's worked fine for everyone else.
02-20-2012, 03:17 AM #13
|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.


woah,there is a shit ton of optimization that can be done to simplify your code. did you make this when you first started c++?

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo