Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Please help to write a program in c language that takes a txt file as input which has x lines of a poem.The poem ends

Please help to write a program in c language that takes a txt file as input which has x lines of a poem.The poem ends with a period. After the end of the input stage, the program will print how many lines and words are in the poem and how many words are on each line of the poem. The first line of output provides the total words and lines in the poem, and the second line is a space-delimited list of the number of words on each line of the poem provided. See Sample Input and Output for more details.

Sample Input and Output 1 $ ./poetryL2 poem.txt

15 words on 3 lines

7 5 3

Sample Input and

Output 2 $ ./poetryL2 poem2.txt

37 words on 6 lines

7 6 6 5 9 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions