You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<stdio.h>
#include<stdlib.h>
int main()
{
File*fptr;
char ch;
fptr=fopen("test. txt","r");
if(fptr==null)
{
printf("unable to open the file please check the name of the file entered. \n");
Exit(exit_failure);
}
do
{
ch=fgetc(fptr);
putchar(ch);
}
while(ch!=EOF);
fclose(fptr);
return 0;
}
Write a program to read an existing file.
Test Data :
Input the file name to be opened: test.txt
Expected Output :
The content of the file test.txt is :
This is the content of the file
The text was updated successfully, but these errors were encountered: