C program to capitalize the first letter of every word in a file
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Here, we will read data from a file and capitalize the first letter of every word and update data into the file.
Program:
The source code to capitalize the first letter of every word in a file is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
Output:
Explanation:
Here, we created three function readData(), writeData(), and main(). The readData() function is used to read data from file. The writeData() function is used to write data into file.
In the main() function, we wrote data into the file. Then we read data from the file and capitalize the first letter of every word and update data into the file. At last, we printed original data and updated data.
need an explanation for this answer? contact us directly to get an explanation for this answer