整数值1到5并打印乘法 [英] integer value 1 to 5 and print the multiplication

查看:96
本文介绍了整数值1到5并打印乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <stdio.h>
int square(int);
main() {
    int a;
    printf("Enter 1 integer from l—5:");
    scanf("%d", &a};
    square (a);
}
int square (int b);
{
    int I;
    for (I=1; I<=12; I++)
        printf("%d X %d = %d", I, b, I*b);
}




Aboce是关于接收整数值1到5并打印乘法表的C编码.编码出现语法错误,我可以弄清它.




Aboce is the C coding about receive integer value 1 to 5 and print the multiplication table. the coding got syntax error and i can figure it out

推荐答案

#include <stdio.h>
int square(int);
main() {
    int a;
    printf("Enter 1 integer from l—5:");
    scanf("%d", &a};
    square (a);
}
int square (int b);<----this semicolon dont fit, put away it
{
    int I;
    for (I=1; I<=12; I++)
        printf("%d X %d = %d", I, b, I*b);
}


也请看这行:
Also have a look at this line:
scanf("%d", &a};

应该是

scanf("%d", &a);


这篇关于整数值1到5并打印乘法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆