#include <stdio.h>
int main ( )
{
int ivalue = 7; /* simple integer variable */
float fvalue = 10.235; /* simple floating point variable */
printf ("%i \n", ivalue); /* no special format */
printf ("%3i \n", ivalue); /* width of 3 minimum spaces */
printf ("%03i \n", ivalue); /* width of 3 spaces padded with zeros, not spaces) */
printf ("%f \n", fvalue); /* Yikes! No width, but lots of zeros will be printed after the decimal point */
printf ("%9.3f \n", fvalue); /* width of 7 spaces, with only two digits printed pass the decimal */
printf ("%-9.3f \n", fvalue); /* left justify the number , use a minus sign before the width */
return (0);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbiAoICkKCnsKCiAgICBpbnQgICBpdmFsdWUgPSA3OyAgICAgICAgICAgICAvKiBzaW1wbGUgaW50ZWdlciB2YXJpYWJsZSAgICAgICAgICAgKi8KCiAgICBmbG9hdCBmdmFsdWUgPSAxMC4yMzU7ICAgICAgICAgLyogc2ltcGxlIGZsb2F0aW5nIHBvaW50IHZhcmlhYmxlICAgICovCiAgICAKICAgIHByaW50ZiAoIiVpIFxuIiwgaXZhbHVlKTsgICAgICAvKiBubyBzcGVjaWFsIGZvcm1hdCAqLwoKICAgIHByaW50ZiAoIiUzaSBcbiIsIGl2YWx1ZSk7ICAgICAvKiB3aWR0aCBvZiAzIG1pbmltdW0gc3BhY2VzICovCgogICAgcHJpbnRmICgiJTAzaSBcbiIsIGl2YWx1ZSk7ICAgICAgIC8qIHdpZHRoIG9mIDMgc3BhY2VzIHBhZGRlZCB3aXRoIHplcm9zLCBub3Qgc3BhY2VzKSAqLwoKICAgIHByaW50ZiAoIiVmIFxuIiwgZnZhbHVlKTsgICAgICAgIC8qIFlpa2VzISAgTm8gd2lkdGgsIGJ1dCBsb3RzIG9mIHplcm9zIHdpbGwgYmUgcHJpbnRlZCBhZnRlciB0aGUgZGVjaW1hbCBwb2ludCAqLwoKICAgIHByaW50ZiAoIiU5LjNmIFxuIiwgZnZhbHVlKTsgICAgIC8qIHdpZHRoIG9mIDcgc3BhY2VzLCB3aXRoIG9ubHkgdHdvIGRpZ2l0cyBwcmludGVkIHBhc3MgdGhlIGRlY2ltYWwgKi8KCiAgICBwcmludGYgKCIlLTkuM2YgXG4iLCBmdmFsdWUpOyAgICAvKiBsZWZ0IGp1c3RpZnkgdGhlIG51bWJlciAsIHVzZSBhIG1pbnVzIHNpZ24gYmVmb3JlIHRoZSB3aWR0aCAqLwoKICAgIHJldHVybiAoMCk7Cgp9Cgo=