Author Topic: InFix to PostFix Conversion  (Read 1683 times)

administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 69
InFix to PostFix Conversion
« on: December 01, 2010, 06:11:24 am »
I have given here the source code in Turbo C for InFix to PostFix Conversion with the help of Stack (Last In First Out) implementation. For dynamic memory allocation, I have used malloc, realloc and free functions.

The source code can be found at the following location

http://softwareandfinance.com/Turbo_C_InFix2PostFixCnv.php

Xylifrost

  • Guest
InFix to PostFix Conversion
« Reply #1 on: January 06, 2011, 07:00:34 am »
Hi

I want an assembly code for pic16f876a to convert from 16 bit binary number to 5 digit decimal and display it on LCD
can any one help me ?? Binary to Decimal conversion

Xylifrost

  • Guest
InFix to PostFix Conversion
« Reply #2 on: January 09, 2011, 07:09:49 pm »
I did search but I didnt find what I whant I mean 16bit binary to 5 digit decimal
what I found was converting to asci  can that help me some how??

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Re: InFix to PostFix Conversion
« Reply #3 on: January 10, 2011, 01:57:24 pm »
short int ConvertBinary2Decimal(short int bin)
{
    int dec = 0, pos = 0;
    int factor = 1;

    while(bin > 0)
    {
   if( (bin % 10) == 1)
        {
            dec += factor;
   }
   bin /= 10;
   pos++;

   factor = factor * 2;
    }

    return dec;
}


int main()
{

    std::cout << ConvertBinary2Decimal(1010);
}

with print 10.

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1