Actual source code: ex24.c
1: static char help[] = "Tests %d and %g formatting\n";
2: #include <petscsys.h>
4: int main(int argc, char **argv)
5: {
6: PetscFunctionBeginUser;
7: PetscCall(PetscInitialize(&argc, &argv, (char *)0, help));
8: PetscCall(PetscPrintf(PETSC_COMM_WORLD, "A string followed by integer %d\n", 22));
9: PetscCall(PetscPrintf(PETSC_COMM_WORLD, "A string followed by double %5g another %g\n", 23.2, 11.3));
10: PetscCall(PetscPrintf(PETSC_COMM_WORLD, "and then an int %d\n", 30));
12: PetscCall(PetscFinalize());
13: return 0;
14: }
16: /*TEST
18: test:
19: diff_args: -j
21: TEST*/