Roman to Integer Using C program
Program for converting Roman to equivalent Integer:
C Program:
Output 1:
Output 2:
From the above program,
ü The roman numeral is stored in the array 's'.
ü The romans such as 'I','V','X','L','C','D' has specific decimal values which are listed in the value() function in the above program.
ü Let us take CDCM as the input string.
ü Therefore the length of the string will be 4.
ü Thus the final res value will be 1300 and prints the same.
0 Comments