- 1

What is the difference in the two statements..

What is the difference betweenbthis two codes... printf("Pi = %8.5f", 3.14159); /* Pi = 3.14159 */ printf("Pi = %-8.5f", 3.14159); /* Pi = 3.14159 */

13th Apr 2020, 9:14 PM
Computerhead
Computerhead - avatar
1 ответ
+ 1
In the second one....field width is 8 and aligned left. Change the 8 to something like 15, the difference will be more obvious.
13th Apr 2020, 9:21 PM
rodwynnejones
rodwynnejones - avatar