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
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
Explain bitwise shift operators?
What is a program flowchart and explain how does it help in writing a program?
Write a program to print numbers from 1 to 100 without using loop in c?
Can two or more operators such as and be combined in a single line of program code?
How does selection sort work in c?
What is the maximum no. of arguments that can be given in a command line in C.?
Write a program to show the change in position of a cursor using c
Explain how many levels deep can include files be nested?
What is a stream?
Give basis knowledge of web designing ...
Is it possible to pass an entire structure to functions?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Write the syntax and purpose of a switch statement in C.
Write a program to check palindrome number in c programming?