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,lo wer,upper,step;
lower=0;
upper=300;
step=20;
fahr=lower;
while (fahr<=upper)
{celsius=5*(fah r-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
can see. Celsius is uninialized.
/* code */
#include <stdio.h>
main(){
int fahr,celsius,lo wer,upper,step;
lower=0;
upper=300;
step=20;
fahr=lower;
while (fahr<=upper)
{celsius=5*(fah r-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
Comment