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 is scope rule in c?

1018


What does sizeof return c?

1015


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2754


What is break statement?

1061


how we can make 3d venturing graphics on outer interface

4733


Explain what is wrong with this program statement? Void = 10;

1196


List a few unconditional control statement in c.

932


What does %c mean in c?

1031


What is 2c dna?

1023


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2239


What are runtime error?

1084


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1027


What are identifiers c?

1023


write a program to generate address labels using structures?

4524


How can I recover the file name given an open stream or file descriptor?

1033