Programming Practice
Programming Practice
Programming practice
Program 1 Exhibit 1.
gave the inventor the right to name his prize for the invention. The man, who was very clever, asked the king for the
Four grains on the third square – and doubling for each square thereafter.
• A programmer decides to find out how many grains of wheat the inventor will end up with. He tests the program with
• The program is shown below. Complete the trace table to show the total number of grains of wheat received for the first