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


Please Help Members By Posting Answers For Below Questions

How many types of functions are there in c?

579


What is the purpose of scanf() and printf() functions?

714


What are the features of the c language?

640


write an algorithm to display a square matrix.

2218


What are the advantages and disadvantages of pointers?

570






How to Throw some light on the splay trees?

617


What is the easiest sorting method to use?

632


What is the stack in c?

714


What is the difference between int main and void main?

569


How can I sort a linked list?

630


Explain two-dimensional array.

621


What is a MAC Address?

624


What is a pointer in c?

677


What is the function of multilevel pointer in c?

666


What is function what are the types of function?

552