Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program named as countD.c that takes input text file and a digit as arguments, outputs how many times the digit appears in

Write a C program named as countD.c that takes input text file and a digit as arguments, outputs how many times the digit appears in the file.

If the text file does not exist, print out an error message to the terminal.

For example, sample outputs could be like below

$cat test.txt This is a list of courses.

CSC 1010 - COMPUTERS & APPLICATIONS

$./countD test.txt

1 '1' appeared 2 times

$./countD NotExist.txt 1

Error: file not exist.

Hint: you may need to refer to one example getMostFreq.c in iCollege.

Please find it in Course Content -> Program Challenges -> PC9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions