Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,095 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,631 people online right now. Registration is fast and FREE... Join Now!




multilication table

2 Pages V  1 2 >  
Reply to this topicStart new topic

multilication table, multiplication table using array in c language

russluvsarcy
1 Oct, 2007 - 06:57 PM
Post #1

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 15


My Contributions
we have an exercise on arrays to make a multiplication table with the used of c language, i made one but i cant make view the rest the only thing appear are te num from 1-10 vertical and horizontal.

pls help me....

this is the one i made....
CODE

main(){
int a[10];
int i;
    clrscr();
    for(i=0;i<10;i++){
        a[i] = i+5;
    }
    for(i=0;i<10;i++){
        printf(" %i ",a[i]);
    }
    getch();
}

User is offlineProfile CardPM
+Quote Post

nirvanarupali
RE: Multilication Table
1 Oct, 2007 - 07:04 PM
Post #2

D.I.C Foot
Group Icon

Joined: 1 Aug, 2007
Posts: 983



Thanked: 2 times
Dream Kudos: 375
My Contributions
Please use code tag. # button in the upper right, it would be difficult to read your codes. smile.gif
User is offlineProfile CardPM
+Quote Post

russluvsarcy
RE: Multilication Table
1 Oct, 2007 - 07:12 PM
Post #3

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 15


My Contributions
QUOTE(nirvanarupali @ 1 Oct, 2007 - 08:04 PM) *

Please use code tag. # button in the upper right, it would be difficult to read your codes. smile.gif



ooooooopsss sory i forgot!

this the code:

#include<stdio.h>
main(){
int a[10];
int i;
clrscr();
for(i=0;i<10;i++){
a[i] = i+1;
}
for(i=0;i<10;i++){
printf(" %i ",a[i]);
}
getch();
}






i attach the output.....no lines required...i just only need to view the numbers....


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

nirvanarupali
RE: Multilication Table
1 Oct, 2007 - 07:54 PM
Post #4

D.I.C Foot
Group Icon

Joined: 1 Aug, 2007
Posts: 983



Thanked: 2 times
Dream Kudos: 375
My Contributions
Try to search in this forum, you can find same thread as yours.

Click Here

Click here
User is offlineProfile CardPM
+Quote Post

russluvsarcy
RE: Multilication Table
2 Oct, 2007 - 05:19 AM
Post #5

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 15


My Contributions
QUOTE(nirvanarupali @ 1 Oct, 2007 - 08:54 PM) *

Try to search in this forum, you can find same thread as yours.

Click Here

Click here




thanks for the link! i got it!

till next wink2.gif
User is offlineProfile CardPM
+Quote Post

MissyMykie
RE: Multilication Table
3 Oct, 2007 - 04:08 AM
Post #6

New D.I.C Head
*

Joined: 27 Sep, 2007
Posts: 13


My Contributions
* multiplication table */

#include<stdio.h>
#include<conio.h>
void main(void)
{
int i,j;
int n, c;
clrscr();
printf(" ");
printf("Enter a size for your table:\n");
scanf("%d", &n);

for(i=0; i<=n; i++)
{
for(j=1; j<=n; j++)
printf("\t%d", i*j);
printf("\n");
}
printf("\t");
getch();
}



...........try this code!., jaz want to sHare this code,!!..=)..this is one of our exercises that we have made!

This post has been edited by MissyMykie: 3 Oct, 2007 - 04:15 AM
User is offlineProfile CardPM
+Quote Post

russluvsarcy
RE: Multilication Table
3 Oct, 2007 - 06:18 AM
Post #7

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 15


My Contributions
QUOTE(MissyMykie @ 3 Oct, 2007 - 05:08 AM) *

* multiplication table */

#include<stdio.h>
#include<conio.h>
void main(void)
{
int i,j;
int n, c;
clrscr();
printf(" ");
printf("Enter a size for your table:\n");
scanf("%d", &n);

for(i=0; i<=n; i++)
{
for(j=1; j<=n; j++)
printf("\t%d", i*j);
printf("\n");
}
printf("\t");
getch();
}



...........try this code!., jaz want to sHare this code,!!..=)..this is one of our exercises that we have made!




Thanks for the code..... i tried it and it works....

another thing.....does the #include<conio.h> is necessary to run the program? whats the purpose of it?


User is offlineProfile CardPM
+Quote Post

spazzedout
RE: Multilication Table
3 Oct, 2007 - 05:21 PM
Post #8

New D.I.C Head
*

Joined: 3 Oct, 2007
Posts: 41


My Contributions
but how do you do it if it is 11 row and column? how do you display the lines correctly? i made a program so it can display 11 row and 11 column of multiplication table. it didn't show as it is expected. its quite irritating daaaan
User is offlineProfile CardPM
+Quote Post

adeoluwafemi
RE: Multilication Table
11 Oct, 2007 - 12:51 PM
Post #9

New D.I.C Head
*

Joined: 11 Oct, 2007
Posts: 5


My Contributions
Hi guys. Im going thru the code and i dont really understand it. Like in my c++ class to ask user for input we use

cout<<"Enter number";

But i dont see that in the code to ask user to enter the amount of number on the multiplication table. Can someone rewrite with the cout and cin?
User is offlineProfile CardPM
+Quote Post

russluvsarcy
RE: Multilication Table
13 Oct, 2007 - 06:36 AM
Post #10

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 15


My Contributions
hi there!

what you have seen is just a multiplication table made in basic C.

sorry i cant help you with that....i havent study the C++ yet....the only thing i know is that it has similarity....try to use the code.... and ask for someone who could helped you edit it into C++

good luck dude!
User is offlineProfile CardPM
+Quote Post

BaltaX
RE: Multilication Table
6 Dec, 2007 - 09:09 AM
Post #11

New D.I.C Head
*

Joined: 6 Dec, 2007
Posts: 6


My Contributions
conio.h is a library..
bro. is it all for the multiplication table? i also have a problem doing that one,hahaha, im also from the philippines. thanx
User is offlineProfile CardPM
+Quote Post

cooplis
RE: Multilication Table
6 Dec, 2007 - 09:31 AM
Post #12

D.I.C Head
**

Joined: 11 Sep, 2007
Posts: 77


My Contributions
CODE


#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;


int  main()
{
int i,j;
int n, c;


cout<<(" ");
cout<<("Enter a size for your table:\n");
cin>>(n);

for(i=0; i<=n; i++)
{
for(j=1; j<=n; j++)

cout<<("\t%d", i*j);
cout<<("\n");
}
cout<<("\t");
system("pause");
}


This would be the c++ format, it may have some errors but will display a multiplication table.

enjoy!
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
Time is now: 12/1/08 08:35PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month