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

Whats s or c mean?

596


What does sizeof int return?

596


How do you use a pointer to a function?

637


Is it better to bitshift a value than to multiply by 2?

662


What is call by value in c?

562






Explain what are preprocessor directives?

632


What is register variable in c language?

609


Write a program to generate the Fibinocci Series

671


What is ctrl c called?

601


What does == mean in texting?

670


what is the height of tree if leaf node is at level 3. please explain

1604


Can the sizeof operator be used to tell the size of an array passed to a function?

622


What are qualifiers?

618


Explain argument and its types.

608


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2058