write a C program to print the program itself ?!
Answer Posted / mobashyr
#include<stdio.h>
#include<conio.h>
int main()
{
FILE *fin;
char c;
fin=fopen("prntsrccode.c","r");
if(fin==NULL)
{
printf("Error Opening file in read mode");
exit(1);
}
do
{
c=fgetc(fin);
fputchar(c);
}while(c!=EOF);
fclose(fin);
getch();
return 0;
}
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
What is scope rule in c?
What does sizeof return c?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is break statement?
how we can make 3d venturing graphics on outer interface
Explain what is wrong with this program statement? Void = 10;
List a few unconditional control statement in c.
What does %c mean in c?
What is 2c dna?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What are runtime error?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What are identifiers c?
write a program to generate address labels using structures?
How can I recover the file name given an open stream or file descriptor?