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 / mobashyr

#include<stdio.h>
#include<conio.h>


int main()
{
FILE *fin;
char c;
fin=fopen("prntsrccode.c","r");
if(fin==NULL)
{
printf("Error Opening file in read mode");
exit(1);
}
do
{
c=fgetc(fin);
fputchar(c);
}while(c!=EOF);

fclose(fin);

getch();
return 0;
}

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

For what purpose null pointer used?

1023


Explain what are binary trees?

1034


What is the general form of #line preprocessor?

957


What is a protocol in c?

956


Can main () be called recursively?

1074


What are data types in c language?

1021


How to delete a node from linked list w/o using collectons?

2739


How can I find out how much free space is available on disk?

1021


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2596


What is volatile variable in c?

1059


Explain goto?

1102


how can f be used for both float and double arguments in printf? Are not they different types?

1028


Difference between strcpy() and memcpy() function?

1080


What is c language and why we use it?

1014


What are pointers really good for, anyway?

1022