hello everyone ,,
have a look on the program
really difficult for me to understand the concept
please help

The reason that your numbers look the same when you print them is that by default printf rounds the number to 6 decimal places. If you use something like %.20f, you'll see that your two numbers really look something like this:

float=3.09999990463256835938
double=3.10000000000000008882

So you see that the two numbers are in fact not equal.

The reason for that is that 3.1 can't be exactly represented as an IEEE floating point number and the closest representation using 32 bits is different than the closest representation using 64 bits.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.