multilication table

multiplication table using array in c language

Page 1 of 1

13 Replies - 6892 Views - Last Post: 14 December 2007 - 07:23 AM Rate Topic: -----

#1 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

multilication table

Post icon  Posted 01 October 2007 - 07:57 PM

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....
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();
}



Is This A Good Question/Topic? 0
  • +

Replies To: multilication table

#2 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: multilication table

Posted 01 October 2007 - 08:04 PM

Please use code tag. # button in the upper right, it would be difficult to read your codes. :)
Was This Post Helpful? 0
  • +
  • -

#3 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

Re: multilication table

Posted 01 October 2007 - 08:12 PM

View Postnirvanarupali, on 1 Oct, 2007 - 08:04 PM, said:

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



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 image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: multilication table

Posted 01 October 2007 - 08:54 PM

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

Click Here

Click here
Was This Post Helpful? 0
  • +
  • -

#5 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

Re: multilication table

Posted 02 October 2007 - 06:19 AM

View Postnirvanarupali, on 1 Oct, 2007 - 08:54 PM, said:

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 ;)
Was This Post Helpful? 0
  • +
  • -

#6 MissyMykie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 27-September 07

Re: multilication table

Posted 03 October 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!

This post has been edited by MissyMykie: 03 October 2007 - 05:15 AM

Was This Post Helpful? 0
  • +
  • -

#7 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

Re: multilication table

Posted 03 October 2007 - 07:18 AM

View PostMissyMykie, on 3 Oct, 2007 - 05:08 AM, said:

* 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?
Was This Post Helpful? 0
  • +
  • -

#8 spazzedout  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 03-October 07

Re: multilication table

Posted 03 October 2007 - 06:21 PM

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
Was This Post Helpful? 0
  • +
  • -

#9 adeoluwafemi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-October 07

Re: multilication table

Posted 11 October 2007 - 01:51 PM

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?
Was This Post Helpful? 0
  • +
  • -

#10 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

Re: multilication table

Posted 13 October 2007 - 07:36 AM

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!
Was This Post Helpful? 0
  • +
  • -

#11 BaltaX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 06-December 07

Re: multilication table

Posted 06 December 2007 - 10:09 AM

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
Was This Post Helpful? 0
  • +
  • -

#12 cooplis  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 77
  • Joined: 11-September 07

Re: multilication table

Posted 06 December 2007 - 10:31 AM

#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!
Was This Post Helpful? 0
  • +
  • -

#13 russluvsarcy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-October 07

Re: multilication table

Posted 06 December 2007 - 06:57 PM

View PostBaltaX, on 6 Dec, 2007 - 10:09 AM, said:

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



Nice to know! coni.h you can remove that one....its not necessary at all....Good Luck! :^:
Was This Post Helpful? 0
  • +
  • -

#14 Re1Mu2R3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 14-December 07

Re: multilication table

Posted 14 December 2007 - 07:23 AM

What was the purpose of the "int c;" in the code? I didn't quite see the
variable being used...


By the way, how do we do the table such that we input the number of both the
rows and the columns?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1