write a C program to print the program itself ?!
Answer Posted / jaroosh
The most simple possible program printing itself on windows :
main()
{
char path[255];
sprintf(path,"cmd.exe /c type \"%s\"",__FILE__);
system(path);
}
on Unix you just use "cat" instead of "type" and necessary
fun to call bash command from c program.
| Is This Answer Correct ? | 17 Yes | 23 No |
Post New Answer View All Answers
What is the g value paradox?
Why main is used in c?
Why can't I perform arithmetic on a void* pointer?
Are negative numbers true in c?
Calculate 1*2*3*____*n using recursive function??
Why c is known as a mother language?
What is selection sort in c?
Why is c not oop?
What is %d called in c?
What is the best style for code layout in c?
What is the return type of sizeof?
What is build process in c?
What type is sizeof?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
What is %g in c?