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
For what purpose null pointer used?
Explain what are binary trees?
What is the general form of #line preprocessor?
What is a protocol in c?
Can main () be called recursively?
What are data types in c language?
How to delete a node from linked list w/o using collectons?
How can I find out how much free space is available on disk?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is volatile variable in c?
Explain goto?
how can f be used for both float and double arguments in printf? Are not they different types?
Difference between strcpy() and memcpy() function?
What is c language and why we use it?
What are pointers really good for, anyway?