The shortest code to write a program that will run forever is just 3 characters long - Apparently.
In 1946, mathematician Konrad Zuse wrote a program for his Z3 computer that would execute an infinite loop, demonstrating the concept of a "busy beaver" program. The program consisted of only three characters: "1 0 0". This program will continue to run indefinitely, making it the shortest program known to achieve this feat. The Zuse Z3 computer was one of the first fully automatic digital computers, and this simple program has been verified and run on modern computers.