Hey all. I need to use input and output files, and create a code such that the input value digit sums are added and then output to a file. Here is the problem as given to me:
If anyone can help me out, get started it would be greatly appreciated. Our "hint" if you wanna call it that, was to use pointers and files...The file "original.txt" contains integer numbers in them. You are required to create another file, named "encoded.txt", from the original file.
Write a program "encoding.c" that reads every integer from the "original.txt" file and writes the integer and the sum of the digits of the
integer to the "encoded.txt" file.
The "encoded.txt" contains twice the number of integers compared to the "original.txt" file.
The contents of a sample "original.txt" and "encoded.txt" files are shown below.
original.txt file contents
Corresponding encoded.txt file