“Write a program that inputs the name of a file from user, creates a new file called “output.txt” to store the number of words and lines in the input file.”
int main() { char sfilename[100]; do{ cout<<"Input the file name:\n"; cin>>sfilename; int words_num,lines_num; words_num=Getwords(sfilename); lines_num=Getlines(sfilename); cout<<"The number of words is:"<<words_num<<"\n"; cout<<"The number of lines is:"<<lines_num<<"\n"; } while(1); return 0; }