473,399 Members | 3,888 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,399 software developers and data experts.

Decimal to Roman Numerals

Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIX

Jan 24 '07 #1
31 9787


On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIX
OK, show us what you've got so far, and we'll make suggestions

Jan 24 '07 #2


On Jan 24, 9:40 am, "Lew Pitcher" <lpitc...@sympatico.cawrote:
On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXOK, show us what you've got so far, and we'll make suggestions
I have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzz

Jan 24 '07 #3


On Jan 23, 5:43 pm, "ARMAS" <smart.a...@gmail.comwrote:
On Jan 24, 9:40 am, "Lew Pitcher" <lpitc...@sympatico.cawrote:
On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXOK, show us what you've got so far, and we'll make suggestionsI have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzz
Quck answer:
DYOH!

Jan 24 '07 #4


On Jan 24, 9:54 am, "user923005" <dcor...@connx.comwrote:
On Jan 23, 5:43 pm, "ARMAS" <smart.a...@gmail.comwrote:
On Jan 24, 9:40 am, "Lew Pitcher" <lpitc...@sympatico.cawrote:
On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXOK, show us what you've got so far, and we'll make suggestionsI have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzzQuck answer:
DYOH!
>>I'm asking for help, not a bullshit answer
Jan 24 '07 #5
>I'm asking for help, not a bullshit answer

That is where you are wrong (in both regards).
You are not asking for help. You are asking for someone to do your
homework for you. That is decidedly not helpful for your future but
harmful.
Because of your attitude, I am sure that any code answer you receive
will be rather humorous.

Jan 24 '07 #6


On Jan 24, 10:15 am, "user923005" <dcor...@connx.comwrote:
>>I'm asking for help, not a bullshit answerThat is where you are wrong (in both regards).
You are not asking for help. You are asking for someone to do your
homework for you. That is decidedly not helpful for your future but
harmful.
Because of your attitude, I am sure that any code answer you receive
will be rather humorous.

It ain't a homework....

Jan 24 '07 #7
"ARMAS" <sm********@gmail.comwrites:
On Jan 24, 9:54 am, "user923005" <dcor...@connx.comwrote:
On Jan 23, 5:43 pm, "ARMAS" <smart.a...@gmail.comwrote:
On Jan 24, 9:40 am, "Lew Pitcher" <lpitc...@sympatico.cawrote:
On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXOK, show us what you've got so far, and we'll make suggestionsI have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzzQuck answer:
DYOH!
>I'm asking for help, not a bullshit answer
No, you're asking us to do your homework for you.

If you're unable to do it yourself, we'd prefer that you fail the
class.

If you want *help*, we might be able to provide some, but we're not
going to do it all for you.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 24 '07 #8
/*
Since we know it's not for school but he just needs this to do his
important work,
I decided to write a nice converter for him. Enjoy:
*/
#include<stdio.h>
#include<stdlib.h>
int main(int q0,char*q1??(??))??<long q2,q3;int q4=1;typedef struct q5
??<int q6;char*q7;int q8;char*q9;??>q10;q10 q11??(??)=??<
#ifdef q12
??<1000000,"\74\115\55\142\141\162\76",900000,
"\74\103\115\55\142\141\162\76"??>,??<500000,
"\74\104\55\142\141\162\76",400000,"\74\103\104\55 \142\141\162\
\76"??>,??<100000,"\74\103\55\142\141\162\76",9000 0,
"\74\130\103\55\142\141\162\76"??>,??<50000,
"\74\114\55\142\141\162\76",40000,"\74\130\114\55\ 142\141\162\
\76"??>,??<10000,"\74\130\55\142\141\162\76",9000 ,
"\74\111\130\55\142\141\162\76"??>,??<5000,"\74\12 6\55\142\141\162\76"
,4000,"\74\111\126\55\142\141\162\76"??>,
#endif
??<1000,"\115",900,"\103\115"??>,??<500,"\104",400 ,"\103\104"??>,??<
100,"\103",90,"\130\103"??>,??<50,"\114",40,"\130\ 114"??>,??<10,"\130"
,9,"\111\130"??>,??<5,"\126",4,"\111\126"??>,??<1, "\111",1,"\111"??>
??>;int q13=0;if(q0==2)q2=atol(q1??(1??));else??<if(q0==3) ??<q2=atol(
q1??(1??));q4=0;??>else??<printf("\n\105\156\164\1 45\162\40\141\156\40"
"\151\156\164\145\147\145\162\40\166\141\154\165\1 45\72\40"
);scanf("\45\154\144",&q2);??>??>q3=q2;printf("\n\ 45\154\144\40\75\40"
,q3);do??<while(q2>=q11??(q13??).q6)??<printf("\45 \163",q11??(q13??).
q7);q2-=q11??(q13??).q6;??>if(q4)if(q2>=q11??(q13??).q8)? ?<printf(
"\45\163",q11??(q13??).q9);q2-=q11??(q13??).q8;??>q13++;??>while(q2>0)
;return(0);??>

Jan 24 '07 #9
"ARMAS" <sm********@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>

On Jan 24, 9:40 am, "Lew Pitcher" <lpitc...@sympatico.cawrote:
>On Jan 23, 8:36 pm, "ARMAS" <smart.a...@gmail.comwrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXOK, show us what you've got so far, and we'll make
suggestions

I have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzz
There are these things called "books". You probably have not heard of them.
They are in:

a)Libraries.

b)Bookstores.

c)Other places.

You may want to explore "books"; specifically a book about the 'C'
programming language.

When you have something resembling a program that you can't get to work,
feel free to post back to this newsgroup.

Also, if you want to hire me to do your program, I will do a "Roman Numeral"
program for USD $1,500. That is probably about $25/line.

There may be others in this newsgroup who will do it for less. I won't be
hurt if you contract with one of them.

--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
Jan 24 '07 #10
ARMAS wrote:
>
On Jan 24, 10:15 am, "user923005" <dcor...@connx.comwrote:
>I'm asking for help, not a bullshit answerThat is where you are wrong (in both regards).
You are not asking for help. You are asking for someone to do your
homework for you. That is decidedly not helpful for your future but
harmful.
Because of your attitude, I am sure that any code answer you receive
will be rather humorous.

It ain't a homework....
Then what is it? All available evidence says otherwise.

Quoting your previous post:
i'm just a feshmen....
Translation: I'm in school.
maybe i could try but it wil take me a long time...
Translation: I'm lazy.
and i need a quick answer...
Translation: The assignment is due tomorrow.

You've also said you have "no idea" on how to do this. If that's
the case, why are you doing this?

Conclusion: It's homework.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Jan 24 '07 #11
In article <bY******************************@giganews.com>,
David T. Ashley <dt*@e3ft.comwrote:
>Also, if you want to hire me to do your program, I will do a "Roman Numeral"
program for USD $1,500. That is probably about $25/line.

There may be others in this newsgroup who will do it for less. I won't be
hurt if you contract with one of them.
No, no, you don't understand the way we do things here.

Offers of contracts to do homework problems are traditionally done on a
"highest bid" basis; the offer includes a clause that it is invalidated
by anybody posting a higher offer to the thread in which it is made.

I am willing to write a roman numeral converter for the OP for US$2000,
payment in advance by certified check or money order. This offer is
valid until midnight (UTC) this Friday, 2007-01-26, or until a higher
offer is made, whichever comes sooner.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
The ISO C Standard defines the truth in C. Therefore, it makes an excellent
weapon to use in a fight.
--Richard Heathfield in comp.lang.c
Jan 24 '07 #12
dj******@caffeine.csclub.uwaterloo.ca (Dave Vandervies) writes:
In article <bY******************************@giganews.com>,
David T. Ashley <dt*@e3ft.comwrote:
Also, if you want to hire me to do your program, I will do a "Roman
Numeral" program for USD $1,500. That is probably about $25/line.

There may be others in this newsgroup who will do it for less. I won't be
hurt if you contract with one of them.

No, no, you don't understand the way we do things here.

Offers of contracts to do homework problems are traditionally done on a
"highest bid" basis; the offer includes a clause that it is invalidated
by anybody posting a higher offer to the thread in which it is made.

I am willing to write a roman numeral converter for the OP for US$2000,
payment in advance by certified check or money order. This offer is
valid until midnight (UTC) this Friday, 2007-01-26, or until a higher
offer is made, whichever comes sooner.
Isn't it also traditional to offer a discount if the solution can be
submitted directly to the instructor?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 24 '07 #13
On Jan 23, 9:07 pm, Keith Thompson <k...@mib.orgwrote:
dj3va...@caffeine.csclub.uwaterloo.ca (Dave Vandervies) writes:
In article <bYGdncwo09hxUyvYnZ2dnUVZ_vWtn...@giganews.com>,
David T. Ashley <d...@e3ft.comwrote:
>Also, if you want to hire me to do your program, I will do a "Roman
>Numeral" program for USD $1,500. That is probably about $25/line.
>There may be others in this newsgroup who will do it for less. I won't be
>hurt if you contract with one of them.
No, no, you don't understand the way we do things here.
Offers of contracts to do homework problems are traditionally done on a
"highest bid" basis; the offer includes a clause that it is invalidated
by anybody posting a higher offer to the thread in which it is made.
I am willing to write a roman numeral converter for the OP for US$2000,
payment in advance by certified check or money order. This offer is
valid until midnight (UTC) this Friday, 2007-01-26, or until a higher
offer is made, whichever comes sooner.Isn't it also traditional to offer a discount if the solution can be
submitted directly to the instructor?
I already posted a working solution (under conditional compilation it
also uses the bar notation for huge roman numeral values) and thereby
claim all prizes.
I also get the grade, if it is above a C.
However, getting tossed out on your ear for plagiarism I leave to the
O.P. untouched and pristine.
--
Keith Thompson (The_Other_Keith) k...@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 24 '07 #14


On Jan 24, 12:07 am, Keith Thompson <k...@mib.orgwrote:
dj3va...@caffeine.csclub.uwaterloo.ca (Dave Vandervies) writes:
In article <bYGdncwo09hxUyvYnZ2dnUVZ_vWtn...@giganews.com>,
David T. Ashley <d...@e3ft.comwrote:
>Also, if you want to hire me to do your program, I will do a "Roman
>Numeral" program for USD $1,500. That is probably about $25/line.
>There may be others in this newsgroup who will do it for less. I won't be
>hurt if you contract with one of them.
No, no, you don't understand the way we do things here.
Offers of contracts to do homework problems are traditionally done on a
"highest bid" basis; the offer includes a clause that it is invalidated
by anybody posting a higher offer to the thread in which it is made.
I am willing to write a roman numeral converter for the OP for US$2000,
payment in advance by certified check or money order. This offer is
valid until midnight (UTC) this Friday, 2007-01-26, or until a higher
offer is made, whichever comes sooner.
Isn't it also traditional to offer a discount if the solution can be
submitted directly to the instructor?

--
Keith Thompson (The_Other_Keith) k...@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.- Hide quoted text -- Show quoted text -
I bid my college tuition for next year - see
http://www.virginia.edu/Facts/Glance_Tuition.htm - plus expenses (I
figure your pry going to want it to run on Alpha systems, so I going to
want one of those to develop on - see
http://h18002.www1.hp.com/alphaserver - hurry, sale ends soon. A SPARC
system might also be nice.) I'll assign the copyrights of the code to
you, but I keep the hardware.

-Ravi Sood http://accordian.sourceforge.net

Jan 24 '07 #15

If this isn't homework, I would love to know how you ended up with such
a project.
On Jan 23, 7:18 pm, "ARMAS" <smart.a...@gmail.comwrote:
On Jan 24, 10:15 am, "user923005" <dcor...@connx.comwrote:
>I'm asking for help, not a bullshit answerThat is where you are wrong (in both regards).
You are not asking for help. You are asking for someone to do your
homework for you. That is decidedly not helpful for your future but
harmful.
Because of your attitude, I am sure that any code answer you receive
will be rather humorous.It ain't a homework....
Jan 24 '07 #16
ARMAS <sm********@gmail.comwrote:
I have no idea .... i'm just a feshmen.... maybe i could try but it
wil take me a long time... and i need a quick answer... plzzzz
Either try it yourself or accept that maybe you should have started
this little project a little bit earlier. Plenty of freshmen before
you have figured at least that much out, or possibly gone on to flip
burgers. You still have a choice; I suggest you choose wisely.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Jan 24 '07 #17
ARMAS wrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIX
I wrote a program to do this. I won't give you all of it but I will give
you a framework where you can fill in the algorithm.

#include <stdio.h>
#include <string.h>

/*
Known Roman numerals are:
I=1, V=5, X=10, L=50, C=100, D=500, M=1000
Anything greater is represented by appending '~'s.
Each '~' represents multiplication by 1000.

The length of the input is unlimited.
*/

static const char *rom[] = {
"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX",
"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC",
"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"
};

int main(int argc, char **argv)
{
size_t i, j, k, len, m, numdig;
const char *p;

if(argc != 2)
{
fprintf(stderr, "Usage requires one argument: "
"a decimal number to convert.\n");
return 0;
}
numdig = strlen(argv[1]);
for(i = 0; i < numdig; i++)
{
j = numdig - i - 1; /* reverse index */

if(argv[1][i] < '0' || argv[1][i] '9')
{
putchar('\n');
fprintf(stderr, "Invalid digit: %c\n", argv[1][i]);
return 0;
}

/* Add your algorithm here. How to determine
which element of the 'rom' array to
output?

It's all about mathematics. Think about the
values of:

argv[1][i] - '0'

j % 3

j % 3 * 10

j / 3
*/

}
putchar('\n');
return 0;
}

--
Simon.
Jan 24 '07 #18
Hi;

I would like to learn how the below mentioned program works.

how does ??< evaluate to a '(' and how ??( to '['

could u ppl give a short explanation and if possible point me to some
info I can read to get more info on this.

Thanks & regards
Rethish
On Jan 24, 7:47 am, "user923005" <dcor...@connx.comwrote:
/*
Since we know it's not for school but he just needs this to do his
important work,
I decided to write a nice converter for him. Enjoy:
*/
#include<stdio.h>
#include<stdlib.h>
int main(int q0,char*q1??(??))??<long q2,q3;int q4=1;typedef struct q5
??<int q6;char*q7;int q8;char*q9;??>q10;q10 q11??(??)=??<
#ifdef q12
??<1000000,"\74\115\55\142\141\162\76",900000,
"\74\103\115\55\142\141\162\76"??>,??<500000,
"\74\104\55\142\141\162\76",400000,"\74\103\104\55 \142\141\162\
\76"??>,??<100000,"\74\103\55\142\141\162\76",9000 0,
"\74\130\103\55\142\141\162\76"??>,??<50000,
"\74\114\55\142\141\162\76",40000,"\74\130\114\55\ 142\141\162\
\76"??>,??<10000,"\74\130\55\142\141\162\76",9000 ,
"\74\111\130\55\142\141\162\76"??>,??<5000,"\74\12 6\55\142\141\162\76"
,4000,"\74\111\126\55\142\141\162\76"??>,
#endif
??<1000,"\115",900,"\103\115"??>,??<500,"\104",400 ,"\103\104"??>,??<
100,"\103",90,"\130\103"??>,??<50,"\114",40,"\130\ 114"??>,??<10,"\130"
,9,"\111\130"??>,??<5,"\126",4,"\111\126"??>,??<1, "\111",1,"\111"??>
??>;int q13=0;if(q0==2)q2=atol(q1??(1??));else??<if(q0==3) ??<q2=atol(
q1??(1??));q4=0;??>else??<printf("\n\105\156\164\1 45\162\40\141\156\40"
"\151\156\164\145\147\145\162\40\166\141\154\165\1 45\72\40"
);scanf("\45\154\144",&q2);??>??>q3=q2;printf("\n\ 45\154\144\40\75\40"
,q3);do??<while(q2>=q11??(q13??).q6)??<printf("\45 \163",q11??(q13??).
q7);q2-=q11??(q13??).q6;??>if(q4)if(q2>=q11??(q13??).q8)? ?<printf(
"\45\163",q11??(q13??).q9);q2-=q11??(q13??).q8;??>q13++;??>while(q2>0)
;return(0);??>
Jan 24 '07 #19
Rethish wrote:
I would like to learn how the below mentioned program works.

how does ??< evaluate to a '(' and how ??( to '['
It's (an obscure) part of the definition of C; they're called
"trigraphs". They don't 'evaluate', they represent.
could u ppl give a short explanation and if possible point me to some
info I can read to get more info on this.
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.

--
Chris "not Wise at all" Dollin
"Life is full of mysteries. Consider this one of them." Sinclair, /Babylon 5/

Jan 24 '07 #20
Chris Dollin said:
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.
I ympathie. I have the ame problem here. If your order arrive before mine,
would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.

--
Richard Heathfield
"Uenet is a trange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 24 '07 #21
oops Sorry!!

thanks for the tip

I would also like to know if there is a way to "disguise" starements
like printf/scanf/define in a similar fashion.

Thanks & regards
Rethish

On Jan 24, 9:06 pm, Richard Heathfield <r...@see.sig.invalidwrote:
Chris Dollin said:
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.I ympathie. I have the ame problem here. If your order arrive before mine,
would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.

--
Richard Heathfield
"Uenet is a trange place" - dmr 29/7/1999http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 24 '07 #22


On 24 Jan, 16:06, Richard Heathfield <r...@see.sig.invalidwrote:
Chris Dollin said:
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.I ympathie. I have the ame problem here. If your order arrive before mine,
would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.
I thi a viru? My ytem eem to be afflicted a well...

Or might it be becaue of the tea in my keyboard?
--
Richard Heathfield
"Uenet is a trange place" - dmr 29/7/1999http://www.cpax.org.uk
How did that character after the "i" get in there?

Jan 24 '07 #23


On 24 Jan, 16:14, "Rethish" <rethishku...@gmail.comwrote:
[Regarding the use of trigraphs]
I would also like to know if there is a way to "disguise" starements
like printf/scanf/define in a similar fashion.
Look up the IOCC (International Obfuscated C Contest) and you'll find
loads of even better ideas... (for some value of better).

By the way, please don't top-post...

Jan 24 '07 #24
ma**********@pobox.com wrote:
>
On 24 Jan, 16:06, Richard Heathfield <r...@ee.ig.invalidwrote:
Chri Dollin aid:
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.I ympathie. I have the ame problem
here. If your order arrive before mine,
I "" a vowel?
would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.

I thi a viru? My ytem eem to be afflicted a well...

Or might it be becaue of the tea in my keyboard?
The "tea" i working jut fine on both of our keyboard. The "e" appear
to be tuck. Perhap a broken LIP connection i dropping what it think
i an xoff?
--
Richard Heathfield
"Uenet is a trange place" - dmr 29/7/1999http://www.cpax.org.uk

How did that character after the "i" get in there?
A lip of the finger?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\pamcop.net | www.fptech.com | <td_diclaimer.h |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th**********@gmail.com>

Jan 24 '07 #25
>>>>"CBM" == Christopher Benson-Manica <at***@norge.freeshell.orgwrites:

CBMPlenty of freshmen before you have figured at least that much
CBMout, or possibly gone on to flip burgers. You still have a
CBMchoice; I suggest you choose wisely.

Oh, no, they don't go on to flip burgers. They transfer to the
business school, where they learn to make my life a living hell.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net
Jan 24 '07 #26
Rethish wrote:
>
I would like to learn how the below mentioned program works.

how does ??< evaluate to a '(' and how ??( to '['

could u ppl give a short explanation and if possible point me to some
info I can read to get more info on this.
How does 'u ppl' evaluate to coherent English? How does rude
top-posting expect to provoke explanations?

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews

Jan 24 '07 #27
ARMAS wrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIX
I'm through with doing homework in this lifetime.
Jan 24 '07 #28


On Jan 24, 2:43 pm, Simon Biber <n...@ralmin.ccwrote:
ARMAS wrote:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXI wrote a program to do this. I won't give you all of it but I will give
you a framework where you can fill in the algorithm.

#include <stdio.h>
#include <string.h>

/*
Known Roman numerals are:
I=1, V=5, X=10, L=50, C=100, D=500, M=1000
Anything greater is represented by appending '~'s.
Each '~' represents multiplication by 1000.

The length of the input is unlimited.
*/

static const char *rom[] = {
"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX",
"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC",
"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"

};int main(int argc, char **argv)
{
size_t i, j, k, len, m, numdig;
const char *p;

if(argc != 2)
{
fprintf(stderr, "Usage requires one argument: "
"a decimal number to convert.\n");
return 0;
}
numdig = strlen(argv[1]);
for(i = 0; i < numdig; i++)
{
j = numdig - i - 1; /* reverse index */

if(argv[1][i] < '0' || argv[1][i] '9')
{
putchar('\n');
fprintf(stderr, "Invalid digit: %c\n", argv[1][i]);
return 0;
}

/* Add your algorithm here. How to determine
which element of the 'rom' array to
output?

It's all about mathematics. Think about the
values of:

argv[1][i] - '0'

j % 3

j % 3 * 10

j / 3
*/

}
putchar('\n');
return 0;

}--
Simon.

Thanks a lot, all i need is little clue... thank you bro....

Jan 25 '07 #29
On Jan 25, 2:25 am, "ARMAS" <smart.a...@gmail.comwrote:
>Thanks a lot, all i need is little clue... thank you bro....
{insert clue-by-four joke here}

Actually, you will find that once you actually make the effort yourself
to write such a function (and it's not all that difficult, as evidenced
by the fact that *I* could do it) and post it here, asking for
suggestions and improvements you will find that the entire tone of how
you are treated will change. Trying to browbeat the newsgroup into
free consulting and having the work done for you will result in nothing
but gags at your expense (where's Peter Seebach when you need him!?)

Jan 25 '07 #30
user923005 wrote, On 25/01/07 19:45:
On Jan 25, 2:25 am, "ARMAS" <smart.a...@gmail.comwrote:
<snip>
you are treated will change. Trying to browbeat the newsgroup into
free consulting and having the work done for you will result in nothing
but gags at your expense (where's Peter Seebach when you need him!?)
Well, if he is buying the gag and pays my travelling expenses I will
happily gag him. :-)
--
Flash Gordon
Jan 25 '07 #31
On Wed, 24 Jan 2007 13:04:54 -0500, Kenneth Brody
<ke******@spamcop.netwrote:
ma**********@pobox.com wrote:
<snip: missing 's's>
The "tea" i working jut fine on both of our keyboard. The "e" appear
to be tuck. Perhap a broken LIP connection i dropping what it think
i an xoff?
#if OT
This is an FGA on comp.protocols.ppp.

1) build and use the original, not some distro's hacked-up version *

2) use asyncmap a0000 to workaround implementations that need to
protect xon/xoff and brokenly don't negotiate it correctly

(* this FGA also applies to comp.protocols.time.ntp)
#endif

/* we now return you to your regularly scheduled c.l.c */

- David.Thompson1 at worldnet.att.net
Feb 6 '07 #32

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

Similar topics

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#
3
by: jcris25 | last post by:
pls help me on how to make a program by converting the day, month and year to a roman numerals... im looking forward..tnx and god bless...
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...
22
by: kotlakirankumar | last post by:
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 ::::::: kotlakirankumar@gmail.com...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.