Sign Up

Talk Programming , Career, Mental Health, Talk Personal Finance ❤️‍ Post a query and receive responses ✅

Have an account? Sign In


Have an account? Sign In Now

Sign In

Post a query and receive responses. Ask anything, Ask Mitra ❤️‍

Sign Up Here


Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.


Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Ask Mitra

Ask Mitra Logo Ask Mitra Logo

Ask Mitra Navigation

  • Home
  • About Us
  • Find Jobs
  • Blogs
    • Add New Blog !
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Ask a Question
  • Home
  • All Categories
  • Find Jobs
  • Points and Swags
    • Badges and Points
    • Ask Mitra Swags
  • Blog
    • Add New Blog !
  • FAQs
  • Community Members 💓
  • About Us
  • Contact Us
Home| Questions|Q 85624
Next
In Process
Najus
NajusBeginner
Asked: December 7, 20222022-12-07T08:02:03+05:45 2022-12-07T08:02:03+05:45In: Programming

Postfix Expression for a^b^c

I found it quite confusing. Any clarification would be appreciated.

query
  • -1
  • 5 5 Answers
  • 73 Views
  • 0 Followers
  • 0
Share
  • Facebook

    Related Questions

    • How good is KU's B.Tech AI course?
    • How is string immutable ?
    • Why I am not seeing option to switch to dark mode in this website?
    • How to get verified symbol in account in this website?
    • Is dark mode available for this askITSNP site?

    You must login to add an answer.


    Forgot Password?

    Need An Account, Sign Up Here

    5 Answers

    • Voted
    • Oldest
    • Recent
    • Random
    1. THE BIG OCEAN Explainer
      2022-12-20T19:53:39+05:45Added an answer on December 20, 2022 at 7:53 pm

      In a postfix expression( Reverse Polish notation), the operator is placed after the operands (the values on which the operator operates).

      For the expression “a^b^c”, the postfix notation would be “ab^c^”. Here, the “^” operator is placed after the operands “a” and “b”, and then after the result of the first operation (“a^b”) and the operand “c”.

      In other words, the postfix notation for the expression “a^b^c” would be:

      1. Calculate the value of “a^b”
      2. Calculate the value of “(a^b)^c”

      The order of operations is important in this expression. In infix notation (the standard notation most people are familiar with), the expression “a^b^c” would be interpreted as “a^(b^c)”, which would give a different result.

      For example, if “a” is 2, “b” is 3, and “c” is 4, the postfix notation “ab^c^” would give the result 2^(3^4), which is 2^81 = 68719476736. In infix notation, the expression “a^b^c” would be interpreted as “2^(3^4)”, which would give the result 2^81 = 1.

      I hope this helps clarify the concept of postfix notation. Let me know if you have any further questions.

      • 1
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
      • Najus Beginner
        2022-12-24T08:15:28+05:45Replied to answer on December 24, 2022 at 8:15 am

        Thanks for your answer but I was confused with associativity of ^ operator being from right to left. What about it? Does it have nothing to do with it? Please enlighten me..

        • 1
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
          • Share on LinkedIn
          • Share on WhatsApp
        • Dinesh58 Beginner
          2022-12-25T19:56:06+05:45Replied to answer on December 25, 2022 at 7:56 pm

          Associativity is taken into consideration when there are operators with same precedence (like * and /) . Because of Right to Left associativity, here you would convert the rightmost expression 1st (b^c). You will get different answers based on what associativity you use

          I find that adding brackets makes conversion easier.

          Left-to-Right:

          1. (a^b)^c
          2. (ab^)^c    Here, think of entire (ab^) expression as one operand. Then, based on conversion rules, you just move the 2nd ^ operator to left of c.
          3. ab^c^

          Right-to-Left:

          1. a^(b^c)
          2. a^(bc^)
          3. abc^^
          • 0
          • Share
            Share
            • Share on Facebook
            • Share on Twitter
            • Share on LinkedIn
            • Share on WhatsApp
      • SunilXtha Beginner
        2023-01-14T17:59:32+05:45Replied to answer on January 14, 2023 at 5:59 pm
        This answer was edited.

        THE BIG OCEAN Which programming language are you talking about? I dont know any language which uses ^ as expontiation.

        ^ is Bitwise XOR and evaluated left to right

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
          • Share on LinkedIn
          • Share on WhatsApp
    2. SunilXtha Beginner
      2023-01-14T18:26:35+05:45Added an answer on January 14, 2023 at 6:26 pm

      Postfix expression for a^b^c will be ab^c^.

      As ^(bitwise xor) is evaluated left to right we can write a^b^c as ((a^b)^c). Now as both operand are ^ so they have same precedence. Moving ^ operand to just outside of nearest R.H.S parenthesis we will get answer i.e ab^c^.

       

      Another example for clearence is.

      a+b*c-d

      = a+(b*c)-d

      = (a+(b*c))-d

      = ((a+(b*c))-d)

      => ((a+bc*)-d) [* having greater precedence evaluated first]

      => (abc*+-d) [+,- has same precedence so evaluated Left to Right]

      => abc*+d- [this is the answer]

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Ask A Question

    Your Favourite Topics

    • Announcements
    • Blockchain
    • Books

        • —Non Tech Books
        • —technical books
    • Business and Entrepreneurship
    • Careers
    • College
    • Content and Blog
    • CyberSecurity
    • Design and Arts
    • Devices and Gadgets
    • Digital Marketing
    • Entertainment

        • —Movies-Series-TV
        • —Music
        • —Sports
    • Events
    • For Admins only.
    • Health

        • —Fitness
    • Money

        • —Personal Finance
        • —Stock Market
    • Operating System

        • —linux
        • —windows
    • Other
    • Paid Internship
    • Programming

        • —AI/ML
        • —APIs
        • —C & C#
        • —Django
        • —Flutter
        • —Go
        • —HTML&CSS
        • —Java
        • —JavaScript
        • —Mobile Apps Development
        • —Node Js
        • —NoSQL
        • —Php
        • —Python
        • —React JS
        • —SQL

    Stats

    • Questions 1k
    • Answers 10k
    • Best Answers 391
    • Users 2k

    Top 6 Members This Month

    Vicky

    Vicky

    • 0 Questions
    • 78 Points
    Sensei
    puppet

    puppet

    • 0 Questions
    • 23 Points
    Beginner
    wtfixair

    wtfixair

    • 0 Questions
    • 22 Points
    Beginner
    Dhanmaya

    Dhanmaya

    • 0 Questions
    • 20 Points
    Beginner
    Riyesh

    Riyesh

    • 0 Questions
    • 20 Points
    Beginner
    pranitkarki

    pranitkarki

    • 0 Questions
    • 20 Points
    Beginner

    Trending Tags

    askmitra blockchain c++ career coding College cybersecurity Django Flutter help javascript laptop laravel linux poll Programming python question react web web development wordpress
    • Popular
    • Answers
    • Rounak Agrawal

      Ask Mitra Udemy Courses Giveaway

      • 76 Answers
    • Subedi Bibek

      The Complete JavaScript Course 2022: From Zero to Expert! Udemy ...

      • 73 Answers
    • Subedi Bibek

      Mega Giveaway at askmitra.com 🔥

      • 69 Answers
    • bishwaKiran
      bishwaKiran added an answer Try getting into githubs student program, use your university/collage/school ID… January 30, 2023 at 7:44 pm
    • Sandeep Poudel
      Sandeep Poudel added an answer SOLVED: It was due to unfinished SSL certificate installation January 27, 2023 at 7:11 pm
    • Aashutosh_k
      Aashutosh_k added an answer Software piracy protection system Fingerprint voting system Stock price prediction… January 26, 2023 at 7:37 pm

    Related Questions

    • How to join 100day challenge in Data science project

      • 0 Answers
    • Hi I am doing my major project using CNN. Can ...

      • 0 Answers
    • Can you guys suggest some projects for my final year ...

      • 1 Answer
    • Low end emulator of android studio

      • 2 Answers
    • Can someone briefly explain me difference between Hot reload and ...

      • 2 Answers

    Explore

    • Home
    • Trending Category
      • Programming
      • Web Development
      • —Mobile Apps Development
      • —Stock Market
      • Business and Entrepreneurship
      • Blockchain
      • College
      • —Personal Finance
      • —HTML&CSS
      • —JavaScript
      • —Python
      • —React JS
      • —Node Js
      • —C & C#
      • Content and Blog
      • Careers
    • All Categories
      • Go to All Categories
      • Health
      • —Go
      • —Flutter
      • Digital Marketing
      • —APIs
      • Devices and Gadgets
    • Find Job and Internships
    • Points and Swags
      • Badges and Points
      • Ask Mitra Swags
    • All Blogs
      • Add New Blog !
    • FAQs
    • Community Members 💓
    • Questions
      • Un Answered
      • New Questions
      • Most Seen Questions
      • Most Answered
      • Trending Questions
    • Tags

    Footer

    Ask Mitra

    Ask Mitra

    Ask Mitra is a social question and answer engine that will assist you in forming a community and connecting with others. Talk about programming, your career, your mental health, and your personal finances. ❤️‍ Post a query and receive responses ✅

    Quick Navigation

    • Ask a Question
    • Home
    • All Categories
    • Find Jobs
    • Points and Swags
      • Badges and Points
      • Ask Mitra Swags
    • Blog
      • Add New Blog !
    • FAQs
    • Community Members 💓
    • About Us
    • Contact Us

    Legal Stuff

    • Terms of use and policy