#include <stdio.h>

void main(void)
{
	char buf[100];
	short a = 532;
	int b = 279,c=-273;
	int count,i;
	i = SPRINTF(buf,"GO GO '%s' '%10s' '%-10s' %Z GO GO","hi dave","hi dave","hi dave");
	printf("%s %d\n",buf,i);

	SPRINTF(buf,"%hd%d%d%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4hd%5d%6d%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4hd%-5d%-6d%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4hd%+5d%+6d%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04hd%05d%06d%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	
	SPRINTF(buf,"%hi%i%i%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4hi%5i%6i%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4hi%-5i%-6i%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4hi%+5i%+6i%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04hi%05i%06i%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	
	SPRINTF(buf,"%hx%x%x%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4hx%5x%6x%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4hx%-5x%-6x%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4hx%+5x%+6x%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04hx%05x%06x%n",a,b,c,&count);
	printf("%s %d\n",buf,count);

	SPRINTF(buf,"%hX%X%X%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4hX%5X%6X%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4hX%-5X%-6X%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4hX%+5X%+6X%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04hX%05X%06X%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	
	SPRINTF(buf,"%ho%o%o%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4ho%5o%6o%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4ho%-5o%-6o%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4ho%+5o%+6o%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04ho%05o%06o%n",a,b,c,&count);
	printf("%s %d\n",buf,count);

	SPRINTF(buf,"%hp%p%p%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%4hp%5p%6p%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%-4hp%-5p%-6p%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%+4hp%+5p%+6p%n",a,b,c,&count);
	printf("%s %d\n",buf,count);
	SPRINTF(buf,"%04hp%05p%06p%n",a,b,c,&count);
	printf("%s %d\n",buf,count);

	SPRINTF(buf,"%c%c%n",'a','b',&count);
	printf("%s %d\n",buf,count);
}