multiplication table

The multiplication table needs two tables for Loop to control rows and columns , meanwhile , Internal circulation should be less than or equal to external circulation . Use two examples to illustrate the multiplication table , One is the nine nine multiplication table , One is the multiplication table specified by the number of rows and columns written by the function

multiplication table
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> int main
() { int i, j; for (i = 1; i <= 9; i++) { for (j = 1; j <= i; j++)
printf("%d*%d=%d\t", i,j,i*j); printf("\n"); } system ( "pause" ); return 0; }

A multiplication table with the number of rows and columns specified by itself

Using function to realize ,n Represents the number of rows and columns ( Same number of rows and columns )
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> void
mult_print(int n) { int i; int j; for (i = 1; i <= n; i++) { for (j = 1; j <=
i; j++) { //return (i, j, i*j); printf("%d*%d=%d ", i, j, i*j); } printf("\n");
} } int main() { int n=0; printf(" Enter the number of rows you want to implement the formula table ( The number of columns is the same as the number of rows ):"); scanf("%d", &n);
mult_print(n); system("pause"); return 0; }
 

 

 

Technology
©2020 ioDraw All rights reserved
Swing actual combat Understanding closure about vue in el-date-picker type=daterange The problem of date not echoing Ubuntu 18.04 swap Partition expansion Snake code --c Language Edition visual c++6.0 open 【Golang Basic series 10 】Go language On conditional sentences ifString class —— summary ,String The nature of , Memory resolution , Commonly used APIAdobe Illustrator Publish native support Apple Silicon Test version of the software study java My first class antd table sort