.. .

Jan 16, 2012 at 5:56am
may i ask how to equate letter to number?

ex.)

a=5
b=4
c=8
d=9
e=3
g=7
Jan 16, 2012 at 6:00am
SAMPLE OUTPUT:

enter num:587.9

output:acg.d
Jan 16, 2012 at 6:08am
int value['z'-'a'+1] = {5, 4, 8, 9, 3, 7, ...};
Edit: I read it backwards, but you get the idea.
Last edited on Jan 16, 2012 at 6:09am
Jan 16, 2012 at 11:37am
ne555, I don't think that would work... He wants corresponding letters and numbers. So I guess the best way to do that would be a 2D array...
Jan 16, 2012 at 11:42am
I think parallel arrays would be better, but that's just me. I don't like working with 2D arrays :P
Jan 16, 2012 at 11:56am
ne555 suggestion is good. All you have to do is: int x = value[ch - 'a']; Where ch is 'a' ...
Jan 18, 2012 at 6:14am
tnx to 4 of you who help me :)
its a very big help to me :)

i finished my program \m/
Last edited on Jan 18, 2012 at 6:15am
Topic archived. No new replies allowed.