# include <stdio.h>
void main()
{
if(printf("Hi.. Welcome to sanfoundry"))
{
}
}
OUTPUT:
Hi.. Welcome to sanfoundry
Sample C Program To Display Its Own Source Code As Its Output.
# include <stdio.h>
int main()
{
FILE *fp;
char ch;
fp = fopen(__FILE__,"r");
do
{
ch = getc(fp);
putchar(ch);
}
while (ch != EOF);
fclose(fp);
return 0;
}
OUTPUT:
#include
int main()
{
FILE *fp;
char ch;
fp = fopen(__FILE__,"r");
do
{
ch = getc(fp);
putchar(ch);
}
while (ch != EOF);
fclose(fp);
return 0;
}
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com