write a C program to print the program itself ?!
Answer Posted / abhishek
#include <stdio.h>
static char prog[] = "#include <stdio.h>%c%cstatic char prog[] = %c%s%c;%c%cint main(void)%c{%c printf(prog, 10, 10, 34, prog, 34, 10, 10, 10, 10, 10, 10, 10);%c return 0;%c}%c";
int main(void)
{
printf(prog, 10, 10, 34, prog, 34, 10, 10, 10, 10, 10, 10, 10);
return 0;
}
| Is This Answer Correct ? | 6 Yes | 6 No |
Post New Answer View All Answers
Why is it that not all header files are declared in every C program?
Can we assign integer value to char in c?
What is const and volatile in c?
What are the various types of control structures in programming?
How can I open files mentioned on the command line, and parse option flags?
Can the sizeof operator be used to tell the size of an array passed to a function?
Where are local variables stored in c?
How do you view the path?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
What is #define?
Describe the order of precedence with regards to operators in C.
about c language
Explain goto?
What is the difference between union and anonymous union?
Can the size of an array be declared at runtime?