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

#include<stdio.h>
#include<conio.h>
int main()
{
FILE * fp = NULL;
char c = '\0';
fp = fopen(__FILE__,"r");
while(!feof(fp))
{
c = fgetc(fp);
printf("%c",c);
}
getch();
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1038


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3176


Can a pointer be volatile in c?

943


What is const volatile variable in c?

996


What are actual arguments?

1055


Write a function that will take in a phone number and output all possible alphabetical combinations

1005


What is scope rule of function in c?

1038


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

1883


Is there a way to jump out of a function or functions?

1046


What is a 'null pointer assignment' error?

1176


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1146


given post order,in order construct the corresponding binary tree

2743


Is fortran faster than c?

993


What does %c do in c?

945


What are reserved words?

1058