Computers in Engineering WWW Site - Example 12.3

Example 12.3


C Version

/*
  Demonstration of printf formatting codes.
*/

#include <stdio.h>

main()
{
  /*  Declaration Statements  */
  short n, m;

  printf("C43.C -> Demonstration of printf formatting codes. \n");

  /*  Initializing variables  */
  n = 375;
  m = -12;

  /*  Print variables  */
  printf("n=%10d,m=%10d\n", n, m);

  return(0);
}
/* End of Program C43 */
/*
OUTPUT :

C43.C -> Demonstration of printf formatting codes.
n=       375,m=       -12

*/

Last modified: 21/07/97