Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > progrm for converting integers to roman numerals using files in clanguage

Reply
Thread Tools

progrm for converting integers to roman numerals using files in clanguage

 
 
Bartc
Guest
Posts: n/a
 
      01-27-2008

"Coos Haak" <(E-Mail Removed)> wrote in message
news:zrcu2gei6xrw$(E-Mail Removed)...
> Op Sun, 27 Jan 2008 19:14:38 GMT schreef Bartc:
>
>> Hans Schneider wrote:
>>> On Sun, 27 Jan 2008 03:10:28 +0100 (CET), John J. Smith
>>> <(E-Mail Removed)> wrote:
>>>
>>>> http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>>
>>>> Find below the portable C source code for a program that will print
>>>> all roman numerals from 0 to 5000. Changing the code so it starts
>>>> with 1 is left as an exercise.

>>
>>> Does not compile with LCC-WIN32...

>>
>>> (and I don't even know what "safelib.h" is. Program or compiler
>>> problem?)

>>
>> This worked fine for me. Although had to rename the ConstraintFailed
>> function.
>>
>> safelib.h seems to be used in the string.h header.
>>
>> And the output seems fine apart from slight quibble of using MMMMM for
>> 5000.

>
> Slight? Everything from 4000 onwards had at least four M's in a row
> Perhaps the Romans used a wide (high) character set, the A in ASCII surely
> wasn't known then.


Apparently MMMM is an acceptable way of writing 4000. Without the proper
symbol for 5000 (Bar-V), these are inevitable in the range 4000 to 4999. But
MMMMM?

--

Bart


 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      01-28-2008
Hans Schneider wrote:
> John J. Smith <(E-Mail Removed)> wrote:
>>(E-Mail Removed) wrote:
>>
>>> please help me out

>>
>> Here you go...
>>
>>> the program for converting the integers to roman
>>> numerals using files in the c language from 1-5000 range

>>
>> Find below the portable C source code for a program that will
>> print all roman numerals from 0 to 5000. Changing the code so
>> it starts with 1 is left as an exercise.
>>
>> [snips]
>>
>>> thank you all

>>
>> You're welcome.
>>
>> Here comes the code...

>
> Does not compile with LCC-WIN32...
>
> |
> |Error ronum.c: 62 redefinition of 'ConstraintFailed'


Obviously lcc-win32 is not able to compile legitimate portable C
code. I suggest complaining to the vendor. Jacob Navia reads this
newsgroup.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      01-28-2008
Bartc wrote:
>

.... snip ...
>
> And the output seems fine apart from slight quibble of using
> MMMMM for 5000.


And you want to see ????

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      01-28-2008
CBFalconer <(E-Mail Removed)> writes:
> Hans Schneider wrote:
>> John J. Smith <(E-Mail Removed)> wrote:

[...]
>>> Here comes the code...

>>
>> Does not compile with LCC-WIN32...
>>
>> |
>> |Error ronum.c: 62 redefinition of 'ConstraintFailed'

>
> Obviously lcc-win32 is not able to compile legitimate portable C
> code. I suggest complaining to the vendor. Jacob Navia reads this
> newsgroup.


It appears (though I can't actually confirm this directly) that
lcc-win's library defines, in violation of the standard, a number of
identifiers that should be available to user programs.

The number of programs posted here recently that illustrate this kind
of problem is, shall we say, interesting. It's tempting to suspect
that some of the posters might be deliberately posting such examples
that they already know are mishandled by lcc-win.

Certainly lcc-win has some bugs (as does virtually all software), and
certainly such bugs should be reported, but comp.lang.c is not the
place for lcc-win bug reports. Post to comp.compilers.lcc or contact
jacob directly (or use whatever mechanism is suggested by lcc-win's
documentation).

If lcc-win rejects your program and you honestly don't know whether
the problem is in your program or in the implementation, then by all
means post here and we can help you with the language. But if (and I
emphasize *if*) your purpose is to publicize a bug rather than to
illuminate a C language issue, this isn't the place.

--
Keith Thompson (The_Other_Keith) <(E-Mail Removed)>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Mark Bluemel
Guest
Posts: n/a
 
      01-28-2008
santosh wrote:
>... Unfortunately I have not
> got Windows,


<OT> Are you sure you meant "unfortunately"? </OT>
 
Reply With Quote
 
Bartc
Guest
Posts: n/a
 
      01-28-2008
CBFalconer wrote:
> Bartc wrote:
>>

> ... snip ...
>>
>> And the output seems fine apart from slight quibble of using
>> MMMMM for 5000.

>
> And you want to see ????


V with a bar over it (scale by 1000) for one example. I think there are
other schemes. MMMMM is just about acceptable (especially as funny symbols
are awkward to write and to display), but you can see that trying to write
say 50000 this way will be a little unwieldy.

--
Bart


 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      01-28-2008
Bartc wrote:
> CBFalconer wrote:
>> Bartc wrote:
>>>

>> ... snip ...
>>>
>>> And the output seems fine apart from slight quibble of using
>>> MMMMM for 5000.

>>
>> And you want to see ????

>
> V with a bar over it (scale by 1000) for one example.


I don't think the Romans ever heard of that.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ And TDD/ C++ programming on Android/ String Calculator Kata inC++/ C++and OpenGL on Android with the NDK/c++ Convert Integers to Roman Numerals sterta bole C++ 0 08-27-2012 09:09 PM
Roman Numerals dragonsfall21@gmail.com Java 10 08-18-2007 10:12 PM
Decimal to Roman Numerals ARMAS C Programming 31 02-06-2007 09:54 AM
[QUIZ] Roman Numerals (#22) Ruby Quiz Ruby 25 03-09-2005 08:44 PM
Roman numerals to ints Christopher Benson-Manica C Programming 13 09-17-2003 03:46 PM



Advertisments