Write a program that inputs the name of five cities and stores in a file.

#include<iostream>
#include<fstream.h>
using namespace std;
int main()
{
char city_name[50];
ofstream file(“D:\\city.txt”);
for(int i=0;i<5;i++)
{
cout<<“Enter the name of any city: “<<endl;
cin>>city;
file<<city<<endl;
}
file.close();
system(“cls”); // this function is used for clear screen
system(“color 61″); // it is used for change the color
cout<<“\nWelcome to www.candcpp.com and www.candcpp.net: \n”;
cout<<“\ncheck your d drive file will be created: \n\n”<<endl;
system(“pause”);
return 0;
}