1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hi

Discussion in 'C' started by prem_may10, Oct 3, 2006.

  1. prem_may10

    prem_may10 New Member

    Joined:
    Sep 28, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    hi
    This is premchand. I want to a program which gives the output as source code of the program
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Here it comes

    Code:
    void main()
    {
    	FILE *fp;
    	char ch;
    	fp = fopen(__FILE__,"r");
    	while((ch=fgetc(fp))!=EOF)
    	{
    		printf("%c",ch);
    	}
    	fclose(fp);
    }
    
     

Share This Page