QUOTE(syazhani @ 1 Apr, 2008 - 03:27 AM)

This won't work, you've shown no effort of doing it except telling "start with #include <stdio.h>".
I'm new here and from my observation people over here would like to see your effort in doing so they can point you to the right direction and/or help you with codes.
...a tip though, try googling, this problem is very common so I am sure you will find the solution...
thanks for ur suggestion. acutally i done it but lack something.i need to do the error checking so that the program will show the example output :
Example 4:
Please enter Roman number: MNCI
Invalid input!
Please re-enter Roman number: MCQ
Invalid input!
Please re-enter Roman number: DXC
The equivalent Decimal number is: 590
help!!!
can anyone help me to modify my code ?the code of mine shown below: i think the red color part got problem,kindly help me to solve it .thanks
#include <stdio.h>
#include <string.h>
#include<ctype.h>
int letterValue(char letter);
int convert(char*roman);
int main()
{
int arabicValue,j=0;
char romanString[50];
printf("Please enter a Roman number:");
do
{ gets(romanString);
printf("Invalid input\n");
printf("Please re-enter Roman number:");
}while(romanString[j]!="I,V,X,L,C,D,M"); arabicValue=convert(romanString);
printf("The equivalent Decimal number is %d\n",arabicValue);
return 0;
}
int convert(char *roman)
{
int arabic = 0, tmp;
char *str_p = roman;
while(*str_p)
{
tmp = letterValue(*str_p);
if (letterValue(*++str_p) > tmp)
arabic -= tmp;
else
arabic += tmp;
}
return arabic;
}
int letterValue(char letter)
{
if (toupper(letter) == 'I') return 1;
if (toupper(letter) == 'V') return 5;
if (toupper(letter) == 'X') return 10;
if (toupper(letter) == 'L') return 50;
if (toupper(letter) == 'C') return 100;
if (toupper(letter) == 'D') return 500;
if (toupper(letter) == 'M') return 1000;
return 0;
}