Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7Sr2zcoRD2watXv1G
10 lines
379 B
C
10 lines
379 B
C
/* The same four values RoundingDemo formats, through C's printf, for comparison with Java's %f. */
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
printf("C printf %%.2f of 2.675 : %.2f\n", 2.675);
|
|
printf("C printf %%.1f of 0.35 : %.1f\n", 0.35);
|
|
printf("C printf %%.2f of 1.005 : %.2f\n", 1.005);
|
|
printf("C printf %%.2f of 0.125 : %.2f\n", 0.125);
|
|
return 0;
|
|
}
|