English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

please help me to make a multiplication table.

the output will be 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

for, if and while statement will do..

tnx!!!
I'll appreciate all answers as long as it make sense!!

~PLEASE DON'T ANSWER IF YOU CAN'T UNDERSTAND OR DON'T KNOW HOW TO DO IT.. THIS IS SERIOUS BUSINESS!!!~

2006-09-26 22:23:54 · 5 answers · asked by Anonymous in Computers & Internet Programming & Design

but it's better if while statement is used.

2006-09-26 22:40:51 · update #1

5 answers

#include
#include

void main()
{
int i, j;
clrscr();
for(i=1; i<=10; i++)
{
for(j=1; j<=10; j++)
{
printf(" %d ",,j*i);
}
printf("\n");
}
getch();
}

just copy it in ur turbo c editor and run it.

2006-09-26 22:46:12 · answer #1 · answered by Digitally Й!Й 3 · 0 1

Tsk, tsk. You shouldn't have other people do your homework. You should read my advice to your other question. You need to calm down.
Compile this instead:

#include
#include
#include
time_t t;
int num;
char bah;
int main(void)
{
srand((unsigned) time(&t));
num=((1+(rand() %10)));
printf("Press ENTER to have your fortune told.\r\n");
bah = getc(stdin);
switch (num)
{
case 1:
printf("Energizer Bunny Arrested! - Charged with battery.\r\n");
break;
case 2:
printf("I'm telling the teacher that you're moonlighting.\r\n");
break;
case 3:
printf("ASCII and ye shall recieve.\r\n");
break;
case 4:
printf("Confucious Say: Chicks who take programming too seriously have their hair fall out.\r\n");
break;
case 5:
printf("Avoid criticism.......Say, do, and be NOTHING!\r\n");
break;
case 6:
printf("Back up my hard drive??? Where's the 'reverse' switch?\r\n");
break;
case 7:
printf("Your teacher does the work of 3 men (Curly, Larry, and Moe).\r\n");
break;
case 8:
printf("C:\\DOS C:\\DOS\\RUN RUN DOS RUN!\r\n");
break;
case 9:
printf("Beware of geeks bearing .gifs\r\n");
break;
case 10:
printf("If not for C, we'd be using BASI, PASAL, and OBOL!\r\n");
}
return 0;
}

2006-09-27 09:47:15 · answer #2 · answered by Balk 6 · 0 1

#include
#include

int main(){

int i,j;

printf("\n\n");

for (i=1;i<11;i++){

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

system("pause");
return 0;
}

2006-09-27 00:00:43 · answer #3 · answered by iyiogrenci 6 · 0 0

#include
int main(void)
{
int i=0;
int j=0;
int result;
int d=0;
int w=1;
printf("which number you choose");
scanf("%d",&d);

result=d*j;
for(j=1;j<=10;j++)
printf("%d*%d=%d\n", d,j,d*j);
printf("\n");
return 0;
}

2006-09-26 22:34:18 · answer #4 · answered by Anonymous · 0 1

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

2006-09-26 22:30:05 · answer #5 · answered by Arif 2 · 0 1

fedest.com, questions and answers