本文介绍了K&安培; R2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从第9页k& r 2复制了这段代码,它给出了一个错误,即使我可以看到
。 Celsius未被发现。


/ * code * /


#include< stdio.h>


main(){

int fahr,摄氏,下,上,步;

lower = 0;

upper = 300;

step = 20;

fahr = lower;

while(fahr< = upper)

{celsius = 5 *(fahr-32)/ 9;

printf("%d \ t%d \ n",fahr,celsuis;

fahr = farh +步骤;}}


/ *结束* /


摄氏度在while函数体内初始化。为什么这个
k& r2的
代码不起作用?


比尔

I copied this code from page 9 k&r 2 and it gives an error that even I
can see. Celsius is uninialized.

/* code */

#include <stdio.h>

main(){
int fahr,celsius,lower,upper,step;
lower=0;
upper=300;
step=20;
fahr=lower;
while (fahr<=upper)
{celsius=5*(fahr-32)/9;
printf("%d\t%d\n",fahr,celsuis;
fahr=farh+step;}}

/*end*/

Celsius is intialized within the body of the while function. Why is this
code from k&r2 not working?

Bill

推荐答案




您是否注意到上面一行的摄氏度拼写错误?

Did you notice the misspelling of celsius on the above line?



-

没有人有权销毁另一个人的信念是:b $ b要求经验证据。 - Ann Landers

--
"No one has the right to destroy another person''s belief by
demanding empirical evidence." -- Ann Landers




你应该再看一遍这个消息。难道不是celsuis是

undefined" ;? celsuis?


你有没有得到关于farh的内容?

You should read the message again. Isn''t it rather "celsuis is
undefined"? celsuis?

And did you get something about "farh"?


这篇关于K&安培; R2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 19:05