Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 132 characters in body
Source Link
Glick
  • 111
  • 7

It's a floatfloat, so use %f.

printf("%f" , f); 

If you don't, it's an undefined behaviour. To understand you can try to cast a int with value -1 to an unsigned int.

You will get an huge value.

It's a float, so use %f. If you don't, it's an undefined behaviour.

It's a float, use

printf("%f" , f); 

If you don't it's an undefined behaviour. To understand you can try to cast a int with value -1 to an unsigned int.

You will get an huge value.

added 9 characters in body
Source Link
Spikatrix
  • 20.3k
  • 7
  • 45
  • 85

It's a floatfloat, so use %f%f. If you don't, it's an undefined behaviour.

It's a float, use %f. If you don't it's an undefined behaviour

It's a float, so use %f. If you don't, it's an undefined behaviour.

Source Link
Glick
  • 111
  • 7

It's a float, use %f. If you don't it's an undefined behaviour