打印给定数字的乘法表
接受用户提供的任何需要形成乘法的数字
从 I 的值开始乘以给定数 (=1)
将给定数与 I 的值递增,直到 I 值小于或等于12.
/* Program to print the multiplication table of a given number */
#include <stdio.h>
int main() {
int number, i;
clrscr();
printf("Please enter any number to find multiplication table:");
scanf("%d", &number);
printf("Multiplication table for the given number %d: ", number);
printf("</p><p>");
for(i=1;i<=12;i++){
printf("%d x %d = %d", number, i, number * i);
printf("</p><p>");
}
getch();
return 0;
}
以上就是打印给定数字的乘法表在C中的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号