Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- int main(void) {
- char pi_form[10] = "\0";
- int i;
- for (i=0;i<7;i+=2) {
- sprintf(pi_form, "%%.%dlf", i);
- printf("Format %s -> ", pi_form);
- strcat(pi_form, "\n");
- printf(pi_form, M_PI);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement