Multiplication table in c [closed]
Tips on how to do multiplication table in c??
ummm... two (nested) loops?
This should work. Really.
printf("2x1=2");
printf("2x2=4");
printf("2x3=6");
printf("2x4=8");
...
You should read books this is very basic things of programming you must clear this things yourself.
I personally recommend you not just to post here and get answer
Try reading and try developing by yourself before you post it overhere.
http://www.cprogramming.com/tutorial/c/lesson3.html
int main () {
int n = 10;
int i, j;
// Print row labels
for (i=1; i<=n; i++) {
for (j=1; j<=n; j++) {
//printf("\t%d",i*j);
//Do something here to get it working.. :-)
}
printf("\n");
}
}
You have to use 2 nested loops and if you want to make it more organized, use a two-dimensional array.
精彩评论