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

#include<fstream>
void main()
{
std::ifstream is(__FILE__);

while(!is.eof())
printf("%c", is.get());

is.close();
}

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are structures and unions? State differencves between them.

1100


What are c identifiers?

1039


What is use of integral promotions in c?

1074


What does int main () mean?

958


What are the differences between new and malloc in C?

1072


Explain what is the concatenation operator?

1108


What are the advantage of c language?

1004


Why c language is called c?

950


What is the benefit of using const for declaring constants?

990


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1018


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1204


How does struct work in c?

1031


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1010


Explain the difference between the local variable and global variable in c?

1025


Write a program to print fibonacci series without using recursion?

1066