write the steps to print a C program on a printer?
Answers
Answered by
5
Answer:
Given the task is to print the written C program itself.
We have to write a C program which will print itself. So, we can use file system in C to print the contents of the file of which we are writing the code, like we are writing the code in “code 1.c” file, so we open the file in the read mode and read all the contents of the file and print the results on the output screen.
But, before opening a file in read mode, we must know the name of the file we are writing code in. So, we can use “__FILE__” which is a macro and is by default, returns the path of the current file.
Similar questions