/* Program 1.14 */ /* formatted text output in C*/ /* no hints this time */ /* Used header files */ /* header files */ #include #include /* Main function - our program starts here*/ void main(void) { /* initialization of variables */ double amount_of_mutated_sandwitches_from_mars=234245.345656; int amount_of_bloodfrienzied_penguins=32000; printf("We are leaving everything as is:\n "); printf("Mutated sandwitches from Mars: %f,\n\t bloodfrienzied penguins: %d\n",amount_of_mutated_sandwitches_from_mars,amount_of_bloodfrienzied_penguins); printf("\n"); getch(); printf("But we want to display the amount of mutated sandwitches from Mars(phew!)\n\twith only two places after decimal point:\n "); printf("Mutated sandwitches from Mars: %0.2f,\n\t bloodfrienzied penguins: %d\n",amount_of_mutated_sandwitches_from_mars,amount_of_bloodfrienzied_penguins); printf("\n"); getch(); printf("\t Now we wanna display something in hex:\n "); printf("\tMutated sandwitches from Mars: %lx,\n\t bloodfrienzied penguins: %x\n",amount_of_mutated_sandwitches_from_mars,amount_of_bloodfrienzied_penguins); printf("\n"); getch(); printf("\a"); /* aLaRm!!!!*/ } /* our main program ends here */