473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

progrm for converting integers to roman numerals using files in clanguage

please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
thank you all
Jan 25 '08 #1
22 3171
ko*************@gmail.com said:
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id
Are you sure you're on the right course? You might find management more to
your liking than programming.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jan 25 '08 #2
ko*************@gmail.com wrote:
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
thank you all
You are joking right?

No one is going to do your homework for you. Besides shirking at this
stage is going to leave you looking a fool later on. Post some
semblance of an attempt and you might likely get good help.

Jan 25 '08 #3
ko*************@gmail.com wrote:
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
thank you all
Dork.
Jan 25 '08 #4
ko*************@gmail.com writes:
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
thank you all
Give us your instructor's e-mail address, and we'll be glad to send
the solution directly to him. For a nominal fee, we'll mention your
name.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jan 25 '08 #5
Keith Thompson wrote:
ko*************@gmail.com writes:
>please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
thank you all

Give us your instructor's e-mail address, and we'll be glad to send
the solution directly to him. For a nominal fee, we'll mention your
name.
For a larger fee we will fake the mail to appear to come from you.
Jan 25 '08 #6
On Thu, 24 Jan 2008 23:29:58 -0600, ko*************@gmail.com wrote
(in article
<b4**********************************@q77g2000hsh. googlegroups.com>):
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
As soon as $1000 hits my paypal account I'll send the solution. Have a
nice day.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Jan 25 '08 #7
On 25 Jan, 05:29, kotlakiranku...@gmail.com wrote:
please help me out *the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
*mail id ::::::: * *kotlakiranku...@gmail.com
* thank you all
what does "using files" mean? Can't we dream up a bizzare way of
implementing this? Use file names to store the numbers?

I.dat contains 1
V.dat contains 10
etc.

or
1.dat contains I
5.dat contains V

<pause>

spilt the input into "decades" number 1000's number of 100's
then use the number to generate a filename. Which contains the
answer.

0 -<empty>
1 -"I"
2 -"II"

no probably too silly.

To the OP. Do it on paper first.
--
Nick Keighley
Jan 25 '08 #8
ko*************@gmail.com wrote:
please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com
Ask here, get answers here.

#include<stdio.h>
#define LO 1
#define HI 5000
#define SPAN(min,max)(1-((max)-(min)))
static char*r[SPAN(HI,LO)]={"I","II","III",
/* ... fill in remaining values here ... */
"MMMMCMXCVIII","MMMMCMXCIX","?"};
int main(int argc,char**argv){
if(argv!=r)return main(SPAN(HI,LO),r);
for(puts(*argv);--argc;puts(*++argv));
return argc;
}

--
Eric Sosman
es*****@ieee-dot-org.invalid
Jan 25 '08 #9

"Eric Sosman" <es*****@ieee-dot-org.invalidwrote in message
news:XI******************************@comcast.com. ..
ko*************@gmail.com wrote:
>please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com

Ask here, get answers here.

#include<stdio.h>
#define LO 1
#define HI 5000
#define SPAN(min,max)(1-((max)-(min)))
static char*r[SPAN(HI,LO)]={"I","II","III",
/* ... fill in remaining values here ... */
"MMMMCMXCVIII","MMMMCMXCIX","?"};
Above 1000 you use V, X, L etc with a 'bar' over to scale by 1000.

So not so easy, unless you use a convention like /V.

And the 4000 above looks better as MV-Bar I think. Might be wrong though.

--
Bart
Jan 25 '08 #10
On Fri, 25 Jan 2008 11:02:19 -0600, Bart C wrote
(in article <vC*******************@text.news.blueyonder.co.uk> ):
>
"Eric Sosman" <es*****@ieee-dot-org.invalidwrote in message
news:XI******************************@comcast.com. ..
>ko*************@gmail.com wrote:
>>please help me out the program for converting the integers to roman
numerals using files in the c language from 1-5000 range send the
program to my
mail id ::::::: ko*************@gmail.com

Ask here, get answers here.

#include<stdio.h>
#define LO 1
#define HI 5000
#define SPAN(min,max)(1-((max)-(min)))
static char*r[SPAN(HI,LO)]={"I","II","III",
/* ... fill in remaining values here ... */
"MMMMCMXCVIII","MMMMCMXCIX","?"};

Above 1000 you use V, X, L etc with a 'bar' over to scale by 1000.

So not so easy, unless you use a convention like /V.

And the 4000 above looks better as MV-Bar I think. Might be wrong though.
How about:

_ _ _
V X L

etc.

--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Jan 25 '08 #11
Bart C wrote:
Above 1000 you use V, X, L etc with a 'bar' over to scale by 1000.

So not so easy, unless you use a convention like /V.

And the 4000 above looks better as MV-Bar I think. Might be wrong though.
__
4000 is IV, though MMMM is also used (but becomes awkward for larger
numbers. _
Numbers from one million onwards are written as |X|, the "box" multiplying
by 10**5.

--
Army1987 (Replace "NOSPAM" with "email")
Jan 25 '08 #12
Hans Schneider wrote, On 27/01/08 03:15:
On Sun, 27 Jan 2008 03:10:28 +0100 (CET), John J. Smith
<jj*@localhost.invalidwrote:
>ko*************@gmail.com 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'
|Error c:\lcc\include\safelib.h: 3 Previous definition of 'ConstraintFailed' here
|Warning ronum.c: 62 inconsistent linkage for 'ConstraintFailed' previously declared at c:\lcc\include\safelib.h 3
|2 errors, 1 warning
|1 error
|

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

If you put the compiler in to conforming mode (-ansic is I think the
switch) then it is a compiler problem. If not then I would still say it
is a compiler problem, but it could be a deliberate feature.

C code is allowed to use the identifier ConstraintFailed for anything it
wants.
--
Flash Gordon
Jan 27 '08 #13
Hans Schneider wrote:
>
Does not compile with LCC-WIN32...

|
|Error ronum.c: 62 redefinition of 'ConstraintFailed'
|Error c:\lcc\include\safelib.h: 3 Previous definition of 'ConstraintFailed' here
Bug in lcc-win32, or you're not invoking it in conforming mode.

ConstraintFailed is a valid identifier which lcc-win32 happens to use
in some implementation-specific library. You need to disable compiler
extensions.

Jan 27 '08 #14
Hans Schneider wrote:
On Sun, 27 Jan 2008 03:10:28 +0100 (CET), John J. Smith
<jj*@localhost.invalidwrote:
>>ko*************@gmail.com 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'
|Error c:\lcc\include\safelib.h: 3 Previous definition of
|'ConstraintFailed' here
|Warning ronum.c: 62 inconsistent linkage for 'ConstraintFailed'
|previously declared at c:\lcc\include\safelib.h 3 2 errors, 1 warning
|1 error
|

(and I don't even know what "safelib.h" is. Program or compiler
problem?)
Please post problems with lcc-win32 to <news:comp.compilers.lccwhere
it's author will be able to address them.

PS. I'm surprised that jacob is using an user-space identifier in his
implementation, even in non-conforming mode. Unfortunately I have not
got Windows, so I cannot check this myself at the moment.

<snip code>

Jan 27 '08 #15
Hans Schneider wrote:
On Sun, 27 Jan 2008 03:10:28 +0100 (CET), John J. Smith
<jj*@localhost.invalidwrote:
>ko*************@gmail.com 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.

--
Bart
Jan 27 '08 #16
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
<jj*@localhost.invalidwrote:
>>ko*************@gmail.com 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.
--
Coos
Jan 27 '08 #17

"Coos Haak" <ch*****@hccnet.nlwrote in message
news:zr*****************************@40tude.net...
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
<jj*@localhost.invalidwrote:

ko*************@gmail.com 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
Jan 27 '08 #18
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

Jan 28 '08 #19
Hans Schneider wrote:
John J. Smith <jj*@localhost.invalidwrote:
>>ko*************@gmail.com 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

Jan 28 '08 #20
santosh wrote:
>... Unfortunately I have not
got Windows,
<OTAre you sure you meant "unfortunately"? :-) </OT>
Jan 28 '08 #21
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
Jan 28 '08 #22
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

Jan 30 '08 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ivo | last post by:
Hi, An array contains elements of the form , for example IVa, XIXb, LIX and LXIVc. Does anyone have a function which can sort this array in a way a human would expect it to, with the roman letters...
3
by: | last post by:
Hello All, I'm developing a system to parse and enumerate addresses. The current obstacle is numbered streets. Does anybody know of a module already written to convert integers to their english...
13
by: Christopher Benson-Manica | last post by:
Inspired by a thread on clc++, I decided to try it out... #include <stdio.h> #include <stdlib.h> int main( int argc, char *argv ) { int i; int result=0; int this;
4
by: Patrick Blackman | last post by:
How do you write regular numbers eg 1 23 475896 in roman numerals inC#
7
by: daming23 | last post by:
Hi, I'm taking an online C++ class and having some difficulty understanding the assignments. Can someone please look at the code I wrote to ensure validity? I am not asking for the answer just some...
3
by: maojecel | last post by:
guyz just want to know the simple code or program how to convert integers to roman numerals.. plz do a reply soon.. i badly need it as soon as u answer. plzzz
2
by: bluedemon | last post by:
I've written the program and it works fine. but my instructor said that i can make the program short and use functions in it, but i cant really understand functions that good. so i just need a little...
3
by: mookbooker | last post by:
I have a code written out with zero errors but i know my main() function is completely wrong and after i build the solution i compile it and nothing happens!! Not even cout statements please help. ...
3
by: capoeira26 | last post by:
I have is that my entered Roman numerals work only if the numerlas are entered in large to smaller format. For exapmple if I type MMC program will correctly display 2100, but when I enter MCM it will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.