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

Latest topics

» is india lagging behind china??
Mon Sep 07, 2009 5:15 am by help

» how to install jdk effectively?
Mon Sep 07, 2009 5:13 am by help

» Money is not everything
Sun Aug 16, 2009 4:42 am by Admin

» general knowledge test 4
Wed Jul 01, 2009 2:28 am by Admin

» loop problem...
Mon Apr 27, 2009 12:40 am by help

» companies address with hr email ids
Mon Apr 27, 2009 12:36 am by help

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

» Gate Preparation
Fri Apr 17, 2009 5:40 pm by shubajit

» Now answer this.....
Wed Apr 15, 2009 7:40 pm by shubajit

HIt counter


    c programming.

    Share

    help

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

    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???

    raushancool

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

    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();
    }

    sudeepto

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

    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

    help

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

    re:c programming

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

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

    Sponsored content

    Re: c programming.

    Post  Sponsored content


      Current date/time is Mon Dec 10, 2018 9:58 am