The forum is dedicated to all the Aryan who believe in change and want to be changed

Latest topics

» is india lagging behind china??
c programming. EmptyMon Sep 07, 2009 5:15 am by help

» how to install jdk effectively?
c programming. EmptyMon Sep 07, 2009 5:13 am by help

» Money is not everything
c programming. EmptySun Aug 16, 2009 4:42 am by Admin

» general knowledge test 4
c programming. EmptyWed Jul 01, 2009 2:28 am by Admin

» loop problem...
c programming. EmptyMon Apr 27, 2009 12:40 am by help

» companies address with hr email ids
c programming. EmptyMon Apr 27, 2009 12:36 am by help

» Here is a new trick how to hack windows xp's admin password...
c programming. EmptyWed Apr 22, 2009 1:42 pm by Soumen

» Gate Preparation
c programming. EmptyFri Apr 17, 2009 5:40 pm by shubajit

» Now answer this.....
c programming. EmptyWed Apr 15, 2009 7:40 pm by shubajit

HIt counter


    c programming.

    avatar
    help

    Posts : 25
    Join date : 2009-04-01
    Location : Durgapur

    c programming. Empty c programming.

    Post  help on Thu Apr 02, 2009 2:41 pm

    can any body here write a c programming whose output would be the source code it self???
    avatar
    raushancool

    Posts : 5
    Join date : 2009-04-01
    Age : 31
    Location : kolkata

    c programming. Empty the source code which after executing will give the same source code of itself

    Post  raushancool on Thu Apr 02, 2009 2:59 pm

    //save the file named as FILECOPY.c then execute the given code
    #include<stdio.h>
    #include<conio.h>
    #include<process.h>
    void main()
    {
    FILE *fs;
    char ch;
    clrscr();
    fs=fopen("FILECOPY.c","rb");
    if(fs==NULL)
    {
    puts("CANNOT OPEN SOURCE FILE");
    exit(1);
    }
    while(1)
    {
    ch=fgetc(fs);
    if (ch==EOF)
    break;
    else
    printf("%c",ch);
    }
    fclose(fs);
    getch();
    }
    avatar
    sudeepto

    Posts : 21
    Join date : 2009-03-31
    Age : 31
    Location : heaven in d hell

    c programming. Empty Re: c programming.

    Post  sudeepto on Thu Apr 02, 2009 10:47 pm

    raushan it will b very kind of u if please explain d program for me
    avatar
    help

    Posts : 25
    Join date : 2009-04-01
    Location : Durgapur

    c programming. Empty re:c programming

    Post  help on Sun Apr 05, 2009 7:51 pm

    raushan u have done excelent job.....keep it up...

    Sponsored content

    c programming. Empty Re: c programming.

    Post  Sponsored content


      Current date/time is Sun Apr 21, 2019 5:59 pm