标题:大家帮我看看,这个c语言出了什么问题,找了那么就看不出来
取消只看楼主
胡雄
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2014-1-30
结帖率:66.67%
已结贴  问题点数:20 回复次数:3 
大家帮我看看,这个c语言出了什么问题,找了那么就看不出来
/*program to calculate the product of two numbers.*/
#include<stdio.h>

int vall,va12,va13;

int product(int x, int y);

int main(void)
{
    /*get the first number*/
    printf("enter a number between 1 and 100:");
    scanf("%d",&va11);

    /*get the second number*/
    printf("enter another number between 1 and 100:");
    scanf("%d",&va12);

    /*calculate and display the product*/
    va13=product(va11,va12);
    printf("%d times %d=%d\n",va11,va12,va13);

    return 0;
}

/*function returns the product of the two values providde*/
int product(int x,int y)
{
    return(x*y);





编译错误为E:\multiply.c(12) : error C2065: 'va11' : undeclared identifier
执行 cl.exe 时出错.
因为小弟初学,什么都不明白,希望给的意见
搜索更多相关主题的帖子: function another between display include 
2014-01-30 02:37
胡雄
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2014-1-30
得分:0 
是不是因为编译器的问题啊!我用的是vc6.我初学c语言,不知道该怎么学
2014-01-30 02:47
胡雄
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2014-1-30
得分:0 
谢谢了,但是我改为11还是这个错undeclared identifier,会不会是编译器出了问题啊
2014-01-30 14:20
胡雄
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2014-1-30
得分:0 
现在搞好了,谢谢各位和版主的解答
2014-01-30 20:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-426944-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.525058 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved