StarLighT
Full Member
When God Made Me , He Broke All The Rules .
Posts: 219
|
Post by StarLighT on Apr 26, 2010 8:29:58 GMT -5
Sir , What Formula Should I Use For This . . ? A Program That Will Compute For The Least Number Of 10 Peso , 5 Peso , And 1 Peso Coins Given A Whole Number Amount . Ex.: Input: 67 Output: 10 Peso - 6 5 Peso - 1 1 Peso - 2 ~ Any Help Would Be Greatly Appreciated Tenks
|
|
|
Post by Mr Kin on Apr 27, 2010 8:24:33 GMT -5
Hi Starlight,
You can make use of Turbo C program (download tc201.zip from google.com) that we have previously used in making this program of yours. I have a feeling that this is your assignment in your college course, am i right? Here's my code for your program :
#include<stdio.h> main() { int tens2, fives2, tens,fives,ones,number;
clrscr(); printf("Enter a number : "); scanf("%d", &number);
tens=number / 10;
printf("10 peso is %d \n", tens);
fives=((number % 10) / 5); printf("5 peso is %d\n", fives);
tens2=(tens *10); fives2=(fives * 5);
ones= number - (tens2+fives2) ; printf("1 peso is %d\n", ones);
getche();
}
hope this helps.
Mr. Kin
|
|
|
Post by Mr Kin on Apr 27, 2010 8:34:37 GMT -5
There will be a reboot of this website coming soon. Btw, the Graduation Day DVD is being finalized. I will give an announcement on what day you guys (4th Year 2009-2010 batch) can claim this DVD.
|
|
StarLighT
Full Member
When God Made Me , He Broke All The Rules .
Posts: 219
|
Post by StarLighT on May 3, 2010 11:32:31 GMT -5
Thanks Poh Sir .
Actually , It's Like Advance Summer Class . I'm Using Dev-C++
|
|
|
Post by Mr Kin on May 4, 2010 3:05:48 GMT -5
That's nice.. C++ uses cout and cin.
|
|