Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain the difference between using macro and inline functions?

1053


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

2941


What is enum c++?

1149


What do you understand by zombie objects in c++?

1040


Is c++ vector a linked list?

949


What is the difference between #define debug 0 and #undef debug?

1126


what is data encapsulation in C++?

1010


What is c++ prototype?

1080


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

1049


What is private public protected in c++?

981


Why is c++ still used?

1012


What are static type checking?

1010


Explain what is class definition in c++ ?

1047


Tell me an example where stacks are useful?

983


What is a manipulator in c++?

1172