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 / moumita chatterjee

#include<stdio.h>
#include<conio.h>
int main()
{
FILE *fp;
char c;
fp=fopen("G:\\selfpro.c","r");
if(fp==NULL)
{
puts("File can open");
exit(1);
}
while(1)
{
c=fgetc(fp);
if(c==EOF)
break;
else
printf("%c",c);
}
getch();
return 0;
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1029


Explain how can I pad a string to a known length?

1138


I have a varargs function which accepts a float parameter?

1006


Explain about block scope in c?

1046


What is the difference between the = symbol and == symbol?

1067


Do you know null pointer?

982


What are the data types present in c?

1108


What is the difference between far and near ?

1161


What is adt in c programming?

1118


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1106


what is the format specifier for printing a pointer value?

986


What are static variables in c?

1036


Why is c so important?

1007


What is the difference between new and malloc functions?

1064


How many main () function we can have in a project?

1073