99 multiplication table and its extension

Source: Internet
Author: User

99 the procedure for the multiplication table is as follows:

#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

#include <stdlib.h>

int main ()

{

int i = 0;

int j = 0;

for (i = 1; I <= 9; i++)

{

for (j = 1; J <= I; j + +)

{

printf ("%d*%d=%2d", I, J, I*j);

}

printf ("\ n");

}

System ("pause");

return 0;

}

Note: I control line, J control column, in order to ensure that the multiplication table ranks neatly, to be empty after%d*%d=%2d two spaces after the end of a row of output, jump out of the second for loop, execute printf ("\ n"); make the next output start on the next line

The results of the implementation are as follows:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/79/FE/wKioL1agYKyzDDEDAAAd5dsQmWk616.png "title=" 99 multiplication table. png "alt=" Wkiol1agykyzddedaaad5dsqmwk616.png "/>

The multiplication table is as follows:

#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

#include <stdlib.h>

int main ()

{

int i = 0;

int j = 0;

int n;

scanf ("%d", &n);

for (i = 1; I <= n; i++)

{

for (j = 1; J <= I; j + +)

{

printf ("%d*%d=%2d", I, J, I*j);

}

printf ("\ n");

}

System ("pause");

return 0;

}

Note: On the basis of the 99 multiplication table, you can enter the maximum multiplier yourself, such as input 10, and the result is as follows

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/FE/wKioL1agYb2xlcweAAAiybpZg8c322.png "title=" Multiplication table. png "alt=" Wkiol1agyb2xlcweaaaiybpzg8c322.png "/>












99 multiplication table and its extension

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.