Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C coding to evaluate an arithmetic expression

C coding to evaluate an arithmetic expression

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11898328
    wrote on last edited by
    #1

    Need c coding for the below scenario Case 1: Input: string 1: -(a+b+c) String 2: -a-b-c Output: True Case 2: Input: string 1: -(a-b) String 2: -a-b Output: False

    J L CPalliniC 3 Replies Last reply
    0
    • U User 11898328

      Need c coding for the below scenario Case 1: Input: string 1: -(a+b+c) String 2: -a-b-c Output: True Case 2: Input: string 1: -(a-b) String 2: -a-b Output: False

      J Offline
      J Offline
      jeron1
      wrote on last edited by
      #2

      Post what you have tried and try to ask specific question(s). You're not likely to find someone that will just write it for you.

      "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

      1 Reply Last reply
      0
      • U User 11898328

        Need c coding for the below scenario Case 1: Input: string 1: -(a+b+c) String 2: -a-b-c Output: True Case 2: Input: string 1: -(a-b) String 2: -a-b Output: False

        L Offline
        L Offline
        leon de boer
        wrote on last edited by
        #3

        Hint count the minus signs in your expanded string

        In vino veritas

        1 Reply Last reply
        0
        • U User 11898328

          Need c coding for the below scenario Case 1: Input: string 1: -(a+b+c) String 2: -a-b-c Output: True Case 2: Input: string 1: -(a-b) String 2: -a-b Output: False

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          strtok[^] is your friend.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups