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