Is it possible to write a program which when executed prints itself as the output

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello Sir/Madam,
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 Is it possible to write a program which when executed prints itself as the output?
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 For Example:
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 If my program is
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 public sub PrintMethodItself()
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 {
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 // some coding to print....
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 }
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 my expected output is:
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 public sub PrintMethodItself()
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 {
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 // some coding to print....
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1 }
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#f1f1f1

View the full article
 
Back
Top