+ 1

Someone plz explain me this code 👇👇

#include <iostream> #include <fstream> using namespace std; int main() { ofstream fout; fout.open("Country"); fout << "\t INDIA \n\t USA \n\t PAKISTAN \n\t JAPAN \n\t SRI LANKA \n"; fout.close(); fout.open("Capital"); fout << "DELHI \n WASHINGTON \n KARACHI \n TOKYO \n COLOMBO \n"; fout.close(); const int n = 80; char line1[n], line2[n]; ifstream fin1, fin2; fin1.open("Country"); fin2.open("Capital"); while (fin1 && fin2) { fin1.getline(line1, n); fin2.getline(line2, n); cout << line1 << "-" << line2 << endl; } return 0; }

24th Jan 2022, 7:41 PM
Jainil Raval
Jainil Raval - avatar
1 Odpowiedź
24th Jan 2022, 7:51 PM
SoloProg
SoloProg - avatar