2 Replies - 1523 Views - Last Post: 30 November 2009 - 09:24 PM

#1 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Currency [Rupee] Denomination Program

Posted 27 February 2005 - 03:26 AM

Description: A Simple Indian Rupee denomination Program in Perl.
#                               MONEY DENOMINATION PROGRAM
#                     USING INDIAN RUPEE CURRENCY SYSTEM
#                   A GOOD PROGRAM FOR LEARNING PERL PROGRAMMERS
#                                                         -Sanchit Karve
#                                                        [email protected]



$cash=0;
$tcash=0;
$thou=0;
$fhun=0;
$hun=0;
$ten=0;
$ft=0;
$tw=0;
$five=0;
$two=0;
$one=0;

print"Enter Total Cash to be denominated in Rupee:";
chomp($cash=);
if($cash ge '9' && $cash le '_')
  {
       print"No STRINGS ALLOWED!!";
  }
  else
    {


       $tcash=$cash;
       $thou=int($tcash/1000);
       $tcash-=($thou*1000);
       $hun=int($tcash/100);
       $tcash-=($hun*100);
       if($hun>=5)
         {
              $fhun=1;
              $hun-=5;
         }
       $ten=int($tcash/10);
       $tcash-=($ten*10);
       if($ten>=5)
          {
               $ft=1;
               $ten-=5;
          }
       $tw=int($ten/2);
       $ten-=($tw*2);
       $one=$tcash;
       if($one>=5)
         {
              $five=1;
              $one-=5;
         }
       if($one>=2)
         {
              $two=int($one/2);
              $one-=($two*2);
         }


         print"nnnnn$cash can be denominated into:nn";
         print"$thou  1000/- Notesn" if($thou!=0);
         print"$fhun  500/- Notesn" if($fhun!=0);
         print"$hun  100/- Notesn" if($hun!=0);
         print"$ft  50/- Notesn" if($ft!=0);
         print"$tw  20/- Notesn" if($tw!=0);
         print"$ten  10/- Notesn" if($ten!=0);
         print"$five  5/- Notesn" if($five!=0);
         print"$two  2/- Notesn" if($two!=0);
         print"$one  1/- Notesn" if($one!=0);
         print"nnn  -Sanchit Karven";
    }











Is This A Good Question/Topic? 0
  • +

Replies To: Currency [Rupee] Denomination Program

#2 noordheen   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 29-April 09

Re: Currency [Rupee] Denomination Program

Posted 29 April 2009 - 11:34 PM

acording this is very help ful...may i know how it use in excel
Was This Post Helpful? 0
  • +
  • -

#3 parajf   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 30-November 09

Re: Currency [Rupee] Denomination Program

Posted 30 November 2009 - 09:24 PM

acording this is very help ful...may i know how it use in excel
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1