#include int main(void) { // a pointer of type char(pointer to a string) char* s = "Hello"; // print a string escaped by tab and new line printf("Strings:\n"); printf("\t.%10s.\n\t.%-10s.\n\t.%*s.\n", s, s, 10, s); // print a character represented by decimal printf("A character:\t%c\n", 65); // print a character and % escaped with tab and new line printf("Characters (includes %%):\t%c %%\n", 'A'); // print integers in the form represented by // decimal, hexadecimal and octal printf("Integers\n"); printf("Decimal:\t%i %d %.6i %i %.0i %+i %u\n", 1, 2, 3, 0, 0, 4, -1); printf("Hexadecimal:\t%x %x %X %#x\n", 5, 10, 10, 6); printf("Octal:\t%o %#o %#o\n", 10, 10, 4); // print floating point number printf("Floating point\n"); // print floating point number with rounding printf("Rounding:\t%f %.0f %.32f\n", 1.5, 1.5, 1.3); // print floating point number with padding printf("Padding:\t%05.2f %.2f %5.2f\n", 1.5, 1.5, 1.5); // print floating point number in scientific form printf("Scientific:\t%E %e\n", 1.5, 1.5); // print floating point number in hexadecimal form printf("Hexadecimal:\t%a %A\n", 1.5, 1.5); return 0; }