开发者

Multiplication table in c [closed]

开发者 https://www.devze.com 2023-01-18 13:35 出处:网络
开发者_如何学运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
开发者_如何学运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消