pls help..
paper bills.. 1000, 500, 100, 50, 20, 10, 5, 1..
create a program that will count all the paper bills in
the number being input..
example:
enter a number: 3886
there is/are:
3 ->1000
1 ->500
3 ->100
1 ->50
1 ->20
1 ->10
1 ->5
1 ->1
example2:
enter a number: 728
there is/are:
0 ->1000
1 ->500
2 ->100
0 ->50
1 ->20
0 ->10
1 ->5
3 ->1
Answer Posted / aruna
The above program works gud. But I have small suggestion.
bill_count[i] = (val>=5?val/bill[i]:val);
This val >=5 will be executed every time though it is not
needed. Simpley we can give Quotient value in bill_count[i].
ie
bill_count[i] = val/bill[i];
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Is java based off c++?
Explain unexpected() function?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What type of question are asked in GE code writing test based on c++ data structures and pointers?
Explain Text Manipulation Routines?
What is c++ redistributable?
What is the exit function in c++?
When we use Abstract Class and when we use Interface?where we will implement in real time?
How do you traverse a btree in backward in-order?
How would you use the functions memcpy(), memset(), memmove()?
How does c++ sort work?
What are move semantics?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
What is the difference between an enumeration and a set of pre-processor # defines?
What is the difference between delegation and implemented-in-terms-of?