tags:

views:

128

answers:

4

Tips on how to do multiplication table in c??

+4  A: 

ummm... two (nested) loops?

James Curran
Sorry :-) .....
org.life.java
+1  A: 

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");
    }
    }   
org.life.java
You probably shouldn't have given him the solution... (homework tag).
Alexander Rafferty
Proper indentation is left as an exercise for the reader?
Greg Hewgill
I think he really helped him in a sense..He shouldn't have posted the whole code but should have given him a close hint
fahad
+2  A: 

This should work. Really.

printf("2x1=2");
printf("2x2=4");
printf("2x3=6");
printf("2x4=8");
...
tia
A: 

You have to use 2 nested loops and if you want to make it more organized, use a two-dimensional array.

Ruel