How do you write a program which produces its own source
code as its output?
Answer Posted / vivek
printitself.c
#include <stdio.h>
int main()
{
char ch;
FILE *file;
file=fopen("printitself.c","r");
while((ch=fgetc(file))!=EOF)
printf("%c",ch);
return 0;
}
| Is This Answer Correct ? | 19 Yes | 2 No |
Post New Answer View All Answers
What is a program flowchart and how does it help in writing a program?
What is void c?
How many types of operators are there in c?
How can you restore a redirected standard stream?
write a c program to find the sum of five entered numbers using an array named number
Why do we use int main?
Why are algorithms important in c program?
Why is c so powerful?
What is c standard library?
Describe explain how arrays can be passed to a user defined function
What are pointers really good for, anyway?
What is the use of volatile?
Write a program to reverse a given number in c language?
How do you search data in a data file using random access method?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.