English, asked by mohinidhanure, 4 months ago

write a c++ program to read and display files content​

Answers

Answered by utsavsinghal
1

Answer:

#include<iostream>

#include<fstream>

#include<stdio.h>

using namespace std;

int main()

{

char fileName[30], ch;

fstream fp;

cout<<"Enter the Name of File: ";

gets(fileName);

fp.open(fileName, fstream::in);

if(!fp)

{

cout<<"\nError Occurred!";

return 0;

}

cout<<"\nContent of "<<fileName<<":-\n";

while(fp>>noskipws>>ch)

cout<<ch;

fp.close();

cout<<endl;

return 0;

}

Explanation:

Mark me as Brainliest

Answered by naveensharma0505
1

Answer:

hope it will help u

Attachments:
Similar questions