Hey.. I would like to know how to write a c program which accepts and records deposits when buying an item. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Hey.. I would like to know how to write a c program which accepts and records deposits when buying an item.

the program should record any balances left

26th Aug 2018, 9:12 PM
Godana Emiru
Godana Emiru - avatar
3 Antworten
+ 1
Godana Emiru create a variable for left out balance... initialise is with either zero or some value... do ask user to withdraw or deposit money using scanf and update left out balance variable according.. feel free to ask for any query
27th Aug 2018, 1:47 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
while loop should be used till that balance is not less than zero... do all operation in while
27th Aug 2018, 8:50 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Ketan Lalcheta .. thanks, your answer was very helpful . I would like to ask how I could make the program stop when he has cleared all remaining balance. and the program to keep displaying the remaining balance after he makes each deposit.
27th Aug 2018, 8:49 AM
Godana Emiru
Godana Emiru - avatar