EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

 

A Cashier has a currency notes of denomination 10,50 and 100. If the amount to be withdrawn is input through the keyboard in maximum hundreds, find the total number of currency notes of each denomination the cashier will have to give to the withdrawer

 

1275

 

Hundred rs note=12

50 rs note=1

10 rs note=2

remaining=5

 

class Hundreds

{

public static void main(String args[])

{

int amount=1275;

System.out.println(“Required notes of 100=”+(amt/100));1275/100=>12

System.out.println(“Required notes of 50=”+(amt%100)/50);1275%100=>75

//75/50=>1

System.out.println(“Required notes of 10=”+((amt%100)%50)/10);

1275%100=>75%50=>25/10=2

 

System.out.println(“Required amount=”+((amt%100)%50)%10);

1275%100=>75%50=>25%10=>5

}

}

 

12345%10==>5

12345%100==>45

12345%1000==>345

 

12345/10==>1234

12345/100==>123

Java example programs

Leave a Reply

Your email address will not be published. Required fields are marked *

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer