Breaking News
You are here: Home / Program Code / CPPM / To count currency notes from given amount

To count currency notes from given amount

To count currency notes from given amount

CLS

REM A program to count currency notes from given amount

INPUT "Enter amount:->", amount

IF amount >= 1000 THEN

        WHILE amount >= 1000

                amount = amount - 1000

                count = count + 1

        WEND

END IF

IF amount >= 500 THEN

        WHILE amount >= 500

                cont = cont + 1

                amount = amount - 500

        WEND

END IF

IF amount >= 100 THEN

        WHILE amount >= 100

                amount = amount - 100

                cont1 = cont1 + 1

        WEND

END IF

IF amount >= 50 THEN

        WHILE amount >= 50

                amount = amount - 50

                cont2 = cont2 + 1

        WEND

END IF

IF amount >= 20 THEN

        WHILE amount >= 20

                amount = amount - 20

                cont3 = cont3 + 1

        WEND

END IF

IF amount >= 10 THEN

        WHILE amount >= 10

                amount = amount - 10

                cont4 = cont4 + 1

        WEND

END IF

IF amount >= 5 THEN

        WHILE amount >= 5

                amount = amount - 5

                cont5 = cont5 + 1

        WEND

END IF

IF amount >= 2 THEN

        WHILE amount >= 2

                amount = amount - 2

                cont6 = cont6 + 1

        WEND

END IF

IF amount >= 1 THEN

        WHILE amount >= 1

                amount = amount - 1

                cont7 = cont7 + 1

        WEND

END IF

PRINT

PRINT

PRINT "1000  =  "; count

PRINT

PRINT "500   =  "; cont

PRINT

PRINT "100   =  "; cont1

PRINT

PRINT "50    =  "; cont2

PRINT

PRINT "20    =  "; cont3

PRINT

PRINT "10    =  "; cont4

PRINT

PRINT "5     =  "; cont5

PRINT

PRINT "2     =  "; cont6

PRINT

PRINT "1     =  "; cont7

PRINT
END

Download Paper Solutions from Below Link

About admin

Scroll To Top