Answer
The invention of the computer happened during World War II, as scientists worked to develop new ways to solve complex mathematical problems related to the war effort. The first computers were very large and expensive, and they were used mainly for military purposes. However, as the technology improved, computers became smaller and more affordable, and they began to be used for a wider variety of purposes.