c语言初学者的基础改错题

#include <stdio.h>
int main( )
{
int product(int a, int b );
int x, y, p;
/found/
scanf("%x%y", &x, &y);
p = product(x, y);
printf("The product is :%d\n", p);
}
int product(int a, int b )
{
int c ;
/found/
c= a*b;
/found/

}

你题目的解答代码如下:

#include <stdio.h>
int main()
{
    int product(int a, int b);
    int x, y, p;
    scanf("%d%d", &x, &y); //改成%d
    p = product(x, y);
    printf("The product is :%d\n", p);
}
int product(int a, int b)
{
    int c;
    c = a * b;
    return c; //加上return c;
}

如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!

img

#include <stdio.h>
int main( )
{
int product(int a, int b );
int x, y, p;
scanf("%d%d", &x, &y);
p = product(x, y);
printf("The product is :%d\n", p);
}
int product(int a, int b )
{
int c ;
c= a*b;
return c;

}

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632