write a C program to print the program itself ?!
Answer Posted / moumita chatterjee
#include<stdio.h>
#include<conio.h>
int main()
{
FILE *fp;
char c;
fp=fopen("G:\\selfpro.c","r");
if(fp==NULL)
{
puts("File can open");
exit(1);
}
while(1)
{
c=fgetc(fp);
if(c==EOF)
break;
else
printf("%c",c);
}
getch();
return 0;
}
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Explain how can I pad a string to a known length?
I have a varargs function which accepts a float parameter?
Explain about block scope in c?
What is the difference between the = symbol and == symbol?
Do you know null pointer?
What are the data types present in c?
What is the difference between far and near ?
What is adt in c programming?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
what is the format specifier for printing a pointer value?
What are static variables in c?
Why is c so important?
What is the difference between new and malloc functions?
How many main () function we can have in a project?