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
What is the difference between the functions memmove() and memcpy()?
What is a dll entry point?
How do I run a program in notepad ++?
What is the use of 'using' declaration in c++?
What is the rule of three?
What is the first name of c++?
How do you show the declaration of a virtual constructor?
Do class declarations end with a semicolon?
Explain how to initialize a const data member.
what is c++
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Is swift better than c++?
What is flush c++?
Write a program to find the reverse Fibonacci series starting from N.
Explain class invariant.