How do you write a program which produces its own source
code as its output?
Answer Posted / vivek
printitself.c
#include <stdio.h>
int main()
{
char ch;
FILE *file;
file=fopen("printitself.c","r");
while((ch=fgetc(file))!=EOF)
printf("%c",ch);
return 0;
}
Is This Answer Correct ? | 19 Yes | 2 No |
Post New Answer View All Answers
What is oops c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What are the valid places to have keyword “break”?
Why ca not I do something like this?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
Is it possible to initialize a variable at the time it was declared?
how to find anagram without using string functions using only loops in c programming
Explain what is a pragma?
What is the function of volatile in c language?
What is the use of a conditional inclusion statement in C?
What are keywords in c with examples?
What is anagram in c?
What is the difference between array and pointer in c?
When would you use a pointer to a function?