How it works...
The user is asked to specify how many kilometers the vehicle is required to be rented for. The value entered by the user is assigned to the distance variable. Thereafter, the user is asked to specify what kind of car they want to rent: an AC car or a non-AC car. The option entered by the user is assigned to the car_type variable. Three register variables are defined by the names Acperkm, Nonacperkm, and servicetax.
Because the register variables stay closer to the CPU and their access time is very low when compared to accessing content from memory variables, the register variables are used for those values that are frequently required in computation. The three register variables, Acperkm, Nonacperkm, and servicetax, are initialized ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access