27.Write a program to display content of file. Get link Facebook X Pinterest Email Other Apps - August 17, 2016 Get link Facebook X Pinterest Email Other Apps Comments Waghmare Swati11:28 AM/*To display the content from file */#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("Can't open a file"); exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesWaghmare Swati11:39 AM/*To display the content from file */#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("Can not open a file"); exit(0);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);return 0;}DeleteRepliesReplyReplypandhare Dipali11:28 AM/*to display the content of file*/#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("/n/t cant open this file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplypoonam pusavale11:29 AM/*reading the content from file and display*/#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("con't open a file");exit(0);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliespoonam pusavale11:50 AM/*reading the content from file and display*/#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("con not open a file");exit(0);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);return 0;}DeleteRepliesReplyReplyMubin Pirjade11:33 AMit's a correct program!!#include #include // For exit() int main(){ FILE *fptr; char filename[100], c; printf("Enter the filename to open \n"); scanf("%s", filename); // Open file fptr = fopen(filename, "r"); if (fptr == NULL) { printf("Cannot open file \n"); exit(0); } // Read contents from file c = fgetc(fptr); while (c != EOF) { printf ("%c", c); c = fgetc(fptr); } fclose(fptr); return 0;}ReplyDeleteRepliesunknown12:11 PMrada rada ;DDeleteRepliesReplyReplySayali Daunde11:33 AM//Read and display content of file#include#includevoid main(){char ch;FILE *fp;fp=fopen("abc.txt","r");if(fp==NULL){printf("\ncant open a file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesunknown12:13 PMaaaa hawa topper!!!!! DeleteRepliesReplyReplyDipali Kore11:34 AM//read and display content of file#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("\ncant open a file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesunknown12:14 PMunfortunately correct ahe ;DDeleteRepliesReplyReplymayuri magar11:37 AM#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("can't open file");exit(0);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);return 0;}ReplyDeleteRepliesReplyRadha ghadge11:37 AM#includevoid main(){FILE *fp;char ch;fp=fopen("p1.txt","r");if(fp==NULL){printf("\n Can't open file");exit(0);}ch=fgetc(fp);while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);return 0}ReplyDeleteRepliessaurabh kole12:15 PMThis comment has been removed by the author.DeleteRepliesReplyunknown12:17 PMaaaa hawa chuklch ki ;DDDDDeleteRepliesReplyknown112:23 PMaye kharach chukaley !!!!!!!!DeleteRepliesReplyReplyBhosale Dhanashri SE311:38 AM//opening the file and display content dvb.txt#include#includevoid main(){FILE *fp;char ch;fp=fopen("dvb.txt","r");if(fp==NULL){printf("can't open the file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%C",ch);}fclose(fp);}ReplyDeleteRepliesReplysushma jadhav11:38 AM #includevoid main(){FILE*fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("can't open file");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplypuja khandare11:47 AM#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("\n can't open file");exit(0);}while(ch|=EDF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplyRanjit kalubarme11:53 AM#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("/n/t cant open this file");exit(0);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplysaurabh kole11:58 AM#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("cant open a file");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesunknown12:14 PMhawwach na bhau!!!!!DeleteRepliesReplysaurabh kole12:19 PMthnxDeleteRepliesReplyAmir Khan12:20 PMFALSEDeleteRepliesReplyReplyWadegonkar Aishwarya12:10 PM/*write the content into a file*/#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("cant't open a file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplysonali nagane12:12 PM#include#includevoid main(){FILE*fp;char ch;fp=fopen("\nabc.text","r");if(fp==NULL){printf("\ncan't open file");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplykrushna sontakke12:13 PM#include#includevoid main(){char ch;FILE *fp;fp=fopen("abc.txt","r");if(fp==NULL){printf(" \n Can't open file. \t ");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplyBhanvase Yashoda12:17 PM/*Reading content from file & Display*/#include#includevoid main(){FILE*fp;char ch;fp=fopen("abc.text","r");if(fp==NULL){printf("File not open");exit(0);}while(ch|=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplyAkshay Sidwadkar12:19 PM#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("cant open a file");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplyunknown12:21 PMsonya......ReplyDeleteRepliesReplyAkshay Sidwadkar12:26 PMkai re -_-ReplyDeleteRepliesReplysourabh kole12:29 PMkuth nai..ReplyDeleteRepliesReplysaurabh kole12:30 PMbol na ReplyDeleteRepliesReplyAmruta4:15 PM#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc","r");if(fp==NULL){printf("\n\t Cant open a file");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplyAwate Snehal11:19 AM/*Reading the content from file and display*/#include#includevoid main(){FILE *fp;char ch;fp=fopen("abc.txt","r");if(fp==NULL){printf("cannot open a file");exit(1);}while(ch!=EOF){ch=fgetc(fp);printf("%c",ch);}fclose(fp);}ReplyDeleteRepliesReplysachita jadhav11:25 AM/* write content into file */#include#includevoid main(){ FILE *fp;char str[10];fp=fopen(" abc","w");if(fp==NULL){printf("can't open file");exit(0);}printf("\n enter string");gets(str);fputs(str,fp);fclose(fp);}ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
/*To display the content from file */
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("Can't open a file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/*To display the content from file */
Delete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("Can not open a file");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0;
}
/*to display the content of file*/
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("/n/t cant open this file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/*reading the content from file and display*/
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("con't open a file");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/*reading the content from file and display*/
Delete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("con not open a file");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0;
}
it's a correct program!!
ReplyDelete#include
#include // For exit()
int main()
{
FILE *fptr;
char filename[100], c;
printf("Enter the filename to open \n");
scanf("%s", filename);
// Open file
fptr = fopen(filename, "r");
if (fptr == NULL)
{
printf("Cannot open file \n");
exit(0);
}
// Read contents from file
c = fgetc(fptr);
while (c != EOF)
{
printf ("%c", c);
c = fgetc(fptr);
}
fclose(fptr);
return 0;
}
rada rada ;D
Delete//Read and display content of file
ReplyDelete#include
#include
void main()
{
char ch;
FILE *fp;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("\ncant open a file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
aaaa hawa topper!!!!!
Delete//read and display content of file
ReplyDelete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("\ncant open a file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
unfortunately correct ahe ;D
Delete#include
ReplyDeletevoid main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("can't open file");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0;
}
#include
ReplyDeletevoid main()
{
FILE *fp;
char ch;
fp=fopen("p1.txt","r");
if(fp==NULL)
{
printf("\n Can't open file");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0
}
This comment has been removed by the author.
Deleteaaaa hawa chuklch ki ;DDDD
Deleteaye kharach chukaley !!!!!!!!
Delete//opening the file and display content dvb.txt
ReplyDelete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("dvb.txt","r");
if(fp==NULL)
{
printf("can't open the file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%C",ch);
}
fclose(fp);
}
#include
ReplyDeletevoid main()
{
FILE*fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("can't open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDeletevoid main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("\n can't open file");
exit(0);
}
while(ch|=EDF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("/n/t cant open this file");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("cant open a file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
hawwach na bhau!!!!!
Deletethnx
DeleteFALSE
Delete/*write the content into a file*/
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("cant't open a file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDelete#include
void main()
{
FILE*fp;
char ch;
fp=fopen("\nabc.text","r");
if(fp==NULL)
{
printf("\ncan't open file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDelete#include
void main()
{
char ch;
FILE *fp;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf(" \n Can't open file. \t ");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/*Reading content from file & Display*/
ReplyDelete#include
#include
void main()
{
FILE*fp;
char ch;
fp=fopen("abc.text","r");
if(fp==NULL)
{
printf("File not open");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
#include
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("cant open a file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
sonya......
ReplyDeletekai re -_-
ReplyDeletekuth nai..
ReplyDeletebol na
ReplyDelete#include
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc","r");
if(fp==NULL)
{
printf("\n\t Cant open a file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/*Reading the content from file and display*/
ReplyDelete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("cannot open a file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
}
/* write content into file */
ReplyDelete#include
#include
void main()
{
FILE *fp;
char str[10];
fp=fopen(" abc","w");
if(fp==NULL)
{
printf("can't open file");
exit(0);
}
printf("\n enter string");
gets(str);
fputs(str,fp);
fclose(fp);
}