C:
#include<stdio.h>
int main()
{
char buffer[255];
FILE *pF = fopen("poem.txt", "w");
fprintf(pF, "Once there was an elephant,\nWho tried to use the telephant—\nNo! No! I mean an elephone\nWho tried to use the telephone—\n\n(Dear me! I am not certain quite\nThat even now I’ve got it right.)\nHowe’er it was, he got his trunk\nEntangled in the telephunk;\n\nThe more he tried to get it free,\nThe louder buzzed the telephee—\n(I fear I’d better drop the song\nOf elephop and telephong!))\n");
char poem;
printf("Do you need a read poem again?(N/y) ");
scanf("%c", &poem);
if(poem == 'y' || poem == 'Y'){
FILE *read = fopen("poem.txt", "r");
printf("Here is your poem---->\n");
//char buffer[255];
while(fgets(buffer, 255, read)){
printf("%s", buffer);
}
fclose(read);
}
else if(poem == 'N'){
printf("Poem is saved!");
}
fclose(pF);
return 0;
}
file eka create unata read wenne nane