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. calculator

calculator

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 4 Posters 0 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.
  • A Offline
    A Offline
    abhi sharma
    wrote on last edited by
    #1

    // My first calculator//Abhi's calculator// #include using namespace std; float division (float a, float b) { float a1; a1=a/b; return (a1); } float multiplication (float c, float d) { int a2; a2=c*d; return (a2); } float addition(float e, float f) { int a3; a3=e+f; return(a3); } float subtraction(float g, float h) { int a4; a4=g-h; return(a4); } int main() { char user; float ab; float da; float ans; cout<"<"<"<"<"<>user; if (user == 'D' || user == 'd') { cout<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = division (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = multiplication (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = addition (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = subtraction (ab,da); cout<<"Answer is -> "< press Y or y for yes

    J T 庄 3 Replies Last reply
    0
    • A abhi sharma

      // My first calculator//Abhi's calculator// #include using namespace std; float division (float a, float b) { float a1; a1=a/b; return (a1); } float multiplication (float c, float d) { int a2; a2=c*d; return (a2); } float addition(float e, float f) { int a3; a3=e+f; return(a3); } float subtraction(float g, float h) { int a4; a4=g-h; return(a4); } int main() { char user; float ab; float da; float ans; cout<"<"<"<"<"<>user; if (user == 'D' || user == 'd') { cout<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = division (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = multiplication (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = addition (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = subtraction (ab,da); cout<<"Answer is -> "< press Y or y for yes

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

      what is this? why you post this code here?

      Guidelines for posting questions in the forum Jibesh V P

      1 Reply Last reply
      0
      • A abhi sharma

        // My first calculator//Abhi's calculator// #include using namespace std; float division (float a, float b) { float a1; a1=a/b; return (a1); } float multiplication (float c, float d) { int a2; a2=c*d; return (a2); } float addition(float e, float f) { int a3; a3=e+f; return(a3); } float subtraction(float g, float h) { int a4; a4=g-h; return(a4); } int main() { char user; float ab; float da; float ans; cout<"<"<"<"<"<>user; if (user == 'D' || user == 'd') { cout<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = division (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = multiplication (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = addition (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = subtraction (ab,da); cout<<"Answer is -> "< press Y or y for yes

        T Offline
        T Offline
        Thomas Daniels
        wrote on last edited by
        #3

        What's the question? If you want to share this calculator, then write a tip or an article: Code Project Article FAQ[^]

        In some cases, my signature will be longer than my message...

        <em style="color:red"> <b>ProgramFOX</b></em>

        ProgramFOX

        1 Reply Last reply
        0
        • A abhi sharma

          // My first calculator//Abhi's calculator// #include using namespace std; float division (float a, float b) { float a1; a1=a/b; return (a1); } float multiplication (float c, float d) { int a2; a2=c*d; return (a2); } float addition(float e, float f) { int a3; a3=e+f; return(a3); } float subtraction(float g, float h) { int a4; a4=g-h; return(a4); } int main() { char user; float ab; float da; float ans; cout<"<"<"<"<"<>user; if (user == 'D' || user == 'd') { cout<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = division (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = multiplication (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = addition (ab,da); cout<<"Answer is -> "<"<"<>ab; cout<<"Enter 2nd number ->"<>da; ans = subtraction (ab,da); cout<<"Answer is -> "< press Y or y for yes

          庄 Offline
          庄 Offline
          庄伟东
          wrote on last edited by
          #4

          what's your question ? warning ?

          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