c language to print multiplication table

王林
Release: 2020-05-13 10:52:27
Original
7504 people have browsed it

c language to print multiplication table

The specific code is as follows:

#include <stdio.h>
int main(){
    int i,j,n;
    for(i=1;i<=9;i++){
        // 将下面的for循环注释掉,就输出左下三角形
        for(n=1; n<=9-i; n++)
            printf("        ");
        
        for(j=1;j<=i;j++)
            printf("%d*%d=%2d  ",i,j,i*j);
        
        printf("\n");
    }

    return 0;
}
Copy after login

The running results are as follows:

c language to print multiplication table

The operation after removing the loop The results are as follows:

c language to print multiplication table

# Recommended tutorial: c language tutorial

The above is the detailed content of c language to print multiplication table. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!