The output of multiplication tables in ▲c language
① Positive triangle output
#include <stdio.h>
int main ()
{
int I, j = 0;
for (i = 1; I <= 9; i++)
{
for (j = 1; J <=i; J + +)
{
printf ("%d*%d=%2d\t", I, J, I*j);
}
printf ("\ n");
}
return 0;
}650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/90/wKioL1YBH9LwBNUuAAFzqleXgVI603.jpg "title=" Positive triangle output Multiplication table "alt=" Wkiol1ybh9lwbnuuaafzqlexgvi603.jpg "/>
② inverted triangle output multiplication table
#include <stdio.h>
int main ()
{
int I, j = 0;
for (i = 1; I <= 9; i++)
{
for (j = i; J <=9; J + +)
{
printf ("%d*%d=%2d\t", I, J, I*j);
}
printf ("\ n");
}
return 0;
}650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/90/wKioL1YBIAagHEiNAAEyAdo_zic010.jpg "title=" Inverted triangle output multiplication table "alt=" Wkiol1ybiaagheinaaeyado_zic010.jpg "/>
③ Matrix form Output
#include <stdio.h>
int main ()
{
int I, j = 0;
for (i = 1; I <= 9; i++)
{
for (j = 1; J <=9; J + +)
{
printf ("%d*%d=%2d\t", I, J, I*j);
}
printf ("\ n");
}
return 0;
}650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/93/wKiom1YBHfejJakJAAGV7qN88I8726.jpg "title=" Matrix output multiplication Table "alt=" Wkiom1ybhfejjakjaagv7qn88i8726.jpg "/>
This article is from the "Warm Smile" blog, please be sure to keep this source http://10738469.blog.51cto.com/10728469/1697182
multiplication tables, C language implementation