C程序以X模式显示数字
参考下面给出的C程序算法,以X模式显示数字。
算法
Step 1: Start Step 2: Declare variables Step 3: Read number of rows Step 4: for loop satisfiesif(i==j || i+j==rows-1)print i+1Print " "Step 5: Print new line Step 6: Stop
以X模式打印数字的逻辑如下-
for(i=0;i程序
以下是以X模式显示数字的C程序-
#includemain(){ int i,j,rows; printf("Enter number of rows:\n"); scanf("%d",&rows); for(i=0;i 输出结果 执行上述程序时,会产生以下结果-
Enter number of rows:10 1 1 2 2 3 3 4 4 55 66 7 7 8 8 9 9 10 10
热门推荐
6 圆圆的祝福语简短
9 怎么说祝福语简短
10 幼儿祝福语大全简短卡片
11 写给老师祝福语简短大学
12 周末思念祝福语大全简短
13 简短56岁生日祝福语
14 团队文案祝福语简短励志
15 长辈钻石婚祝福语简短
16 简短霸气的考试祝福语
17 公司上班祝福语大全简短
18 端午发给客户祝福语简短