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

What do you mean by dynamic memory allocation in c? What functions are used?

1160


What are structures and unions? State differencves between them.

1170


Explain the priority queues?

1073


Explain how do you print only part of a string?

1208


What is the basic structure of c?

1076


Is c pass by value or reference?

1031


What is substring in c?

1198


Where static variables are stored in memory in c?

993


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

1033


What is function in c with example?

1143


Why isnt any of this standardized in c?

1073


Why is a semicolon (;) put at the end of every program statement?

1068


Explain how are portions of a program disabled in demo versions?

1116


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1117


What is quick sort in c?

1083