@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> dbtid, I think read will success and return 0 bytes read.
<0> at least this is the behaviour when the remote peer closes the socket.
<1> ping me
<2> in english and some other languages you need another if for values between 10 and 20 thousand, and betwen 10 and 20.
<3> thank you.
<2> so you can see there is a potential for an if ladder beyond the simple example i provided, however it should be easy enough to add later.
<2> 50050 -> fifty thousand and fifty, so you can see that fifty can be reused at each grouping.
<3> yup..
<2> 99 -> ninty nine. 99000 -> ninty nine thousand. same thing. which is where a loop can be handy, though with only 1-100000 as the range it isn't required.
<3> now i get the if..
<3> how about in for?
<3> what should i put in for?>
<2> you could use for to handle each group.
<3> for (jan=1; jan<=10; jan++) <-- this for tens
<3> 10's
<3> one - ten only



<2> well, mostly grouping would be for each group of 3 digits.
<3> one hundred ?
<3> for (jan=1; jan<=100; jan++) <-- for hundreds
<2> in english the words you use for xxx000 and for just xxx are the same, but with the word thousand after it.
<2> again the example: 99 is ninty nine, and 99000 is ninty nine thousand.
<3> so how will i make to print it out ?
<3> yup
<3> how will i call the groupings in array?
<2> a loop would allow you to use the same if ladder to handle the xxx000 part and then the just xxx part, all you have to do is change the suffix when the loop iterates.
<3> aw..
<3> for (jan=1; jan<=10; jan++) <-- is it like this ?
<2> other than the values from 11 to 19 you can just divide to get the index into the word array, with a second array for the words for 11 thru 19.
<2> ***ume you have: char *tens[] = { "ten", "twenty", "thirty", /* etc */ };
<3> okay..
<2> now if you have a value like 35 you want to print words for you can divid it by 10 to get then index into the tens array, and by 10 again for the units array ("one", "two", ...).
<2> so 35 / 10 = 3, and tends[3 - 1 /* because c arrays are zero based */] is "thirty".
<3> ahh..
<3> so..
<3> it will become
<3> for (jan=1; jan<=100/3; jan++) like that ?
<2> i'm not sure what jan represents. you have to ask the user for the value.
<3> printf("Enter Amount: ");
<3> scanf("%c", &jan);
<2> yuck.
<3> why ?
<2> %c doesn't convert a series of digits to a value.
<3> %d then
<2> that's better, yes.
<3> scanf("%d", &jan);
<2> so now jan has a value.
<3> if (jan <= 100)
<2> you can treat it as the part >= 1000, and the remainder.
<3> no remainder allowed..
<2> sigh.
<3> :)
<2> not really.
<2> simple arithmetic seems beyond you, and i'm tired.
<2> C_Dreamer mightbe awake and could handle this easily, but he hasn't said anything yet.
<3> can u do example in for sir ?
<2> i've already done several small examples.
<2> if i do a larger one i'll have done your homework for you.
<3> just a sample in for sir..
<2> he needs to convert values in [1,100000] to words.
<4> Like "one" and such?
<2> aye.
<4> Ew
<3> a
<3> ww
<3> aw
<4> So how far you got, Jantzen?
<4> (other than nowhere)
<3> aw
<3> about what Ashe`?
<4> About your homework?
<3> its our final project
<3> and my prof didn't discuss anything about array
<3> he just said that " that will be our final exam
<5> he's a ****
<3> he just said that its our duty to learn
<3> hmm! he didn't teach us anything about



<3> array
<6> it's much easier using arrays :S
<3> yup.. just like he says..
<4> It's not that difficult to learn arrays...
<4> Takes 5 minutes
<3> Create a Program that will ask Amount from 1-100,000 and convert to words..
<3> hint: use array
<3> just like that
<3> that it.. and then leaves the room
<3> and all the cl*** don't know how to make that program
<4> Good, then all the cl*** will fail
<3> yah
<3> it will
<4> Sounds normal, if they have no idea how to make a program
<3> Today is Jan 11, it will be p*** on Jan 22
<3> 11 remaining days to finish
<4> Also 11 days to start
<4> Of course, talking about your teacher won't get it done
<3> i started it now
<3> char *jan[] = { "one", "two", .... "ten" };
<3> char *jan1[] = { "eleven", "twelve", .... "nineteen" };
<3> char *jan2[] = { "Twenty", "Thirty", .... "ninety" };
<3> then stop
<3> because i don't know what to do next
<3> Ashe`?
<3> help me please T_T
<3> aw
<4> Do you know why you wrote that in the first place?
<3> its an array
<4> And what are you going to do with it?
<3> i dont know what's next
<4> Then why did you write it?
<3> because i know its correct
<3> but i dont know how to do next
<4> Right, then imagine you have the number 35
<4> Without thinking about code, just in your head
<4> How would you make words out of it?
<3> ok
<3> Thirty Five
<4> Ok, and why?
<3> because i know its 35
<4> ...
<4> So it's not because it's 30 + 5?
<4> You just know every single number from 0 to infinity
<4> By heart
<3> yah.. 30+5
<4> And thirty because it's 3 * 10?
<3> divide ?
<4> *major hint*
<4> Divide and modulo should help you a bit
<4> Just try to find how
<3> aw
<3> i just want to know how to use "for" in that problem
<3> and i'll do the others
<5> for ( initialization; while this statment is != 0; increment )
<4> Well, if you keep dividing and such
<4> Eventually, you'll get down to 0, no?
<4> So, while (number != 0)?
<3> no
<4> You must have a strange way to divide
<5> Jan what's 1/10 ?
<5> (integer division)
<3> 1/10?
<3> 0
<3> or negative numbers
<5> which one?
<3> -10 ?
<5> write a short little program to see 1/10
<3> int jan;
<3> jan=1;
<3> jan=jan/10;
<5> in your ide and run it
<3> printf("%d",jan);
<5> and see the out put


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

crossbreed pitbull shitzu
evilhannah
#linuxhelp
#windows
#php
#mirc
#linux
#MissKitten
#chatzone
#c



Home  |  disclaimer  |  contact  |  submit quotes