Code:
 for ( counter = 0; counter < lenght; counter++ )
 {

   if ( romanchar[counter] == 'I' && romanchar[counter+1] == 'V')
   {
      sum = sum + 4; 
      counter++;
   }
That should do the trick.

And gets is bad news. Read the FAQ about that one and use something else for input.