### Problem with a simple beginner program...

Hi,

I tried to build a simple program giving temperatures in °C and °F. Here is the code:

 ``1234567891011121314151617181920212223242526272829303132333435363738`` `````` #include #include using namespace std; int main(){ double Tm=0; //minimum Temp double TM=50000; //Max Temp double T0,T1,Ts; //given minimum, max and step Temps cout<<"Please give in a lower limit >="<>T0; //minimum Temp cout<<"'\n'Please give in a higher limit <="<>T1; //Max Temp cout<<"'\n'Please give in a step, 0 < step < "<>Ts; //step int nbrlines; double nbrline; nbrline = 1+(T1-T0)/Ts; nbrlines=(int)nbrline; //number of lines in the array to use later double array[2][nbrlines]; for(int x=0;x

The problem is that,for temperatures between 10 and 20°C separted by 1°C for instance, the result is correct until T=15°C, the next line is "nan 5.56112e+260" (all the following are false too.

(for a step of °C, I always have "20 68)

Thank you !
Topic archived. No new replies allowed.