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
What is the use of in c?
What does the error 'Null Pointer Assignment' mean and what causes this error?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What do you understand by normalization of pointers?
What is a memory leak? How to avoid it?
What are integer variable, floating-point variable and character variable?
Is array a primitive data type in c?
Write a program to reverse a given number in c language?
What does the file stdio.h contain?
What does c value mean?
Explain the advantages of using macro in c language?
What is difference between scanf and gets?
How can I write a function that takes a format string and a variable number of arguments?
Tell me about low level programming languages.
What does return 1 means in c?