Question: 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

Write a C program named as countD.c that takes input text file

 

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.

Step by Step Solution

3.39 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Heres a C program named countDc that takes an input text file and a digit as arguments an... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!