-1

I was specifically trying to print integer type using %3d but out of curiosity I want to know if it is at all possible to print %(%d)d, considering 3 could be an integer. Tried searching a lot online but only could find basics of %d,%f` etc.

Dharmesh Rupani
  • 1,029
  • 2
  • 12
  • 22
user45341
  • 1
  • 2

1 Answers1

0

You can print on a variable width with this syntax:

printf("%*d", width, number);
chqrlie
  • 131,814
  • 10
  • 121
  • 189