#include #include int main() { // printf an integer printf("Print integers with %%d %d\n", 5); printf("Int %i\n", 56); //print a character printf("%c\n", 'a'); //print a string printf("|%20s|\n", "Hello"); // print a number in hexadedcimal printf("The Hexadecimal value of %d is %X\n", 255, 255); // print a number in octal printf("The Octal value of %d is %o\n", 255, 255); printf ("Characters: %c %c \n", 'a', 65); printf ("Decimals: %d %ld\n", 1977, 650000); printf ("Preceding with blanks: %10d \n", 1977); printf ("Preceding with zeros: %010d \n", 1977); printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100); printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416); printf ("Width trick: |%*d| \n", 5, 10); // the * is replaced with the 5 which is an argument and not part of the string; 5 could be a variable printf ("%s \n", "A string"); system("pause"); return 0; }