Output justify : Formatted Output Int « Console « C / ANSI-C






Output justify

Output justify

#include <stdio.h>

int main(void)
{
  printf(".........................\n");
  printf("right-justified: %8d\n", 100);
  printf(" left-justified: %-8d\n", 100);

  return 0;
}


  

           
       








Related examples in the same category

1.Integer output variations
2.Variations on a single integerVariations on a single integer
3. Print formatted data to stdout: how to use printf Print formatted data to stdout: how to use printf
4.Formatted output: int, float and string
5.Output formatted ramdom integerOutput formatted ramdom integer