That should do the trick.Code:for ( counter = 0; counter < lenght; counter++ ) { if ( romanchar[counter] == 'I' && romanchar[counter+1] == 'V') { sum = sum + 4; counter++; }
And gets is bad news. Read the FAQ about that one and use something else for input.