+ 1

%3.2f" What is he doing?

printf("Pi = %3.2f", 3.14159);

24th Apr 2018, 1:14 PM
Labor Kostya
Labor Kostya - avatar
5 Réponses
+ 7
It rounds 3.14159 to nearest 2 places. The output is 3.14
24th Apr 2018, 1:23 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 5
Labor Kostya You are welcome😊
24th Apr 2018, 1:29 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 4
3.2 means minmum 3 slots including dot and minmum 2 decimal point accuracy like 3.14,4.12,9.28
24th Apr 2018, 3:05 PM
Elliot
Elliot - avatar
+ 1
Thank you)
24th Apr 2018, 1:27 PM
Labor Kostya
Labor Kostya - avatar
+ 1
%3.2 The %3 is just saying to take up 3digit space. And you get the rest from Muhammad Khairul Amirin Bin Yaacob's ans.
24th Apr 2018, 1:38 PM
Akib
Akib - avatar