write a C program to print the program itself ?!
Answer Posted / vikraman85
This can be achieved by file handling,
If r is the name of this file;The following codewil print
this prg.
#include<stdio.h>
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("file.c","r");
ch=getc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=getc(fp);
}
getch();
}
| Is This Answer Correct ? | 19 Yes | 23 No |
Post New Answer View All Answers
code for quick sort?
What are the two types of functions in c?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Is exit(status) truly equivalent to returning the same status from main?
What is the difference between array and structure in c?
what does static variable mean?
What are logical errors and how does it differ from syntax errors?
What is the meaning of ?
What is integer constants?
Which node is more powerful and can handle local information processing or graphics processing?
Can true be a variable name in c?
How important is structure in life?
What is the difference between the expression “++a” and “a++”?
What are the different types of control structures?
What is the purpose of sprintf?