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
can we have joblib in a proc ?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Why do we use main function?
What is difference between structure and union in c?
What are the 4 types of functions?
What do you mean by invalid pointer arithmetic?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
How can I delete a file?
write a program to concatenation the string using switch case?
Is it better to bitshift a value than to multiply by 2?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
How do I determine whether a character is numeric, alphabetic, and so on?
What is multidimensional arrays
What is the use of volatile?
What is d'n in c?