#include <stdio.h> int main () { char buffer [50]; int n, a = 50, b = 37; n = sprintf (buffer, "%d plus %d is %d", a, b, a + b); printf ("[%s] is a %d chars string\n", buffer, n); return 0; }