Two decimal places using printf( )

前端 未结 4 965
攒了一身酷
攒了一身酷 2020-12-24 10:34

I\'m trying to write a number to two decimal places using printf() as follows:

#include 
int main()
{
  printf(\"When this number:         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 11:01

    For %d part refer to this How does this program work? and for decimal places use %.2f

提交回复
热议问题