1 static char help[] = "Tests %d and %g formatting\n"; 2 #include <petscsys.h> 3 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)); 11 12 PetscCall(PetscFinalize()); 13 return 0; 14 } 15 16 /*TEST 17 18 test: 19 diff_args: -j 20 21 TEST*/ 22