Get the FREE certificate on C, C++, Java, Python, Perl, PHP, SQL, Linux & Javascript!  

CppBuzz.com
  
Home C C++ Java Python Perl PHP Spring SQL Javascript Linux Forum

You are here : Home » C Program which prints itself

C Program which prints itself


//file name is print_program.c
#include <stdio.h>

int main(int argc, char *argv[]) {
	
FILE* file = fopen("print_program.c", "r"); 
char line[200];

while (fgets(line, sizeof(line), file)) {

 printf("\n%s", line); 

}

fclose(file);
return 0;
}