Question: C program to read a paragraph from a text file and print each character in the paragraph in the ROMAN numeral equivalent of their ASCII
C program to read a paragraph from a text file and print each character in the paragraph in the ROMAN numeral equivalent of their ASCII value.
You can create any dummy file with multiple line paragraph and test if the program is working or not.
Example: The sentence Hi! would be converted to LXXII CV XXXIII where H = LXXII , i = CV , and ! = XXXIII .
THINGS TO CONSIDER:
*Reading paragraph from the file is important so don't miss it.
*It is a beginner assignment so don't create your own functions and use only
*It shouldn't give an error when compiling as gcc -Wall -pedantic -ansi program.c
*Spaces are mandatory after each character is converted into roman numeral. The conversion should resemble the pattern in the text file as shown below:
Hi !!
!
If the file was in above format then our output should be like below. Here "Hi" doesn't have space in between but our output should separate them with space. Hi and !! are separated by actual space in file and we know the ASCII value of space is 32 so there is XXXII in between Hi and !!. There is another ! in separate line, so our output should also be in separate line.
LXXII CV XXXII XXXIII XXXIII
XXXIII
Use the following ROMAN conversion
C = 100, L = 50, X = 10; V = 5; X = 1
Specials: XC = 90, XL = 40, IX = 9, IV = 4;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
