printf("%3d ",XX);

C
#include <stdio.h>

int main()
{
	int x = 10;
    printf("%3d ",x);
}
Source

Also in C: