Actual source code: ex24.c

petsc-3.7.3 2016-08-01
Report Typos and Errors
  1: static char help[] = "Tests %D and %g formatting\n";
  2: #include <petscsys.h>


  7: int main(int argc,char **argv)
  8: {

 11:   PetscInitialize(&argc,&argv,(char*)0,help);
 12:   PetscPrintf(PETSC_COMM_WORLD,"A string followed by integer %D\n",22);
 13:   PetscPrintf(PETSC_COMM_WORLD,"A string followed by double %5g another %g\n",23.2,11.3);
 14:   PetscPrintf(PETSC_COMM_WORLD,"and then an int %D\n",30);

 16:   PetscFinalize();
 17:   return 0;
 18: }