Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a C program to print the program itself ?!

Answer Posted / vinay tiwari

this can be achieved by file handling

#include<stdio.h>
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("file.c","r");
ch=getc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=getc(fp);
}
getch();
}

Is This Answer Correct ?    63 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to capitalise first letter of each word in a given string?

1931


What is the significance of an algorithm to C programming?

1048


Explain how can you check to see whether a symbol is defined?

1210


What is the difference between formatted&unformatted i/o functions?

1060


Who developed c language?

1102


What are the keywords in c?

1129


What is the use of gets and puts?

1035


Why is this loop always executing once?

1064


Can we declare variable anywhere in c?

981


Why c is a procedural language?

1077


What is structure data type in c?

1030


Explain how do you print only part of a string?

1223


Is there a way to switch on strings?

1091


How can you determine the size of an allocated portion of memory?

1315


What are pragmas and what are they good for?

1001