Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Make A Calculator In C++?
New Posts  All Forums:Forum Nav:

Make A Calculator In C++? - Page 2

post #11 of 18
Thread Starter 
Quote:
Originally Posted by Bobicon View Post

I am using a online GNU C++ compiler (4.8.1) and it works fine:

http://www.compileonline.com/compile_cpp_online.php

Granted you may be running a different version of C++ than it is.

I ran it online and it seems to just auto proceed to the addition function (int add).
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
post #12 of 18
Where to begin with that code. Well first off I went ahead and rewrote it so it works and corrected several errors. I assume you are just starting out.
Warning: Spoiler! (Click to show)
Code:


#include <iostream>
#include <string>
using namespace std;

int add();
int somethingelse();
int min();
int mul();

int n1, n2, total;

int main()
{
    int choice;
    cout << "Please select One Of the Following Options" << endl;
    cout << " \n";
    cout << "Press 1 For ADDING \n";
    cout << "Press 2 For DIVISION \n";
    cout << "Press 3 For SUBTRACTION \n";
    cout << "Press 4 For MULTIPLICATION \n";
    scanf("%d", &choice);
    if(choice == 1)
    add();
        else if(choice == 2)
            somethingelse();
    
        else if(choice == 3)
            min();
    
        else if (choice == 4)
            mul();
    
        else
            printf("Invalid selection");
    
    }

                    int add()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 + n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                
                int somethingelse()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 / n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                int min()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 - n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                int mul()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 * n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}



If this is for homework or something please don't just copy what I did without understanding it as you will never get better.


Ok now back to your code
Code:
#include <iostream>
#include <string>
using namespace std;

int add([B]1[/B]);
int div([B]2[/B]);
int min([B]3[/B]);
int mul([B]4[/B]);

int main()
{
        char choice;
        cout << "Please select One Of the Following Options" << endl;
        cout << " \n";
        cout << "Press 1 For ADDING \n";
        cout << "Press 2 For DIVISION \n";
        cout << "Press 3 For SUBTRACTION \n";
        cout << "Press 4 For MULTIPLICATION \n";
        cin >> choice;
        [B] (choice != 1);[/B]
               [B] {[/B]if (choice == 1)
        {
        int add([B]1[/B]);
        }
                                else
      [B]   ([/B]choice != 2[B])[/B];
              [B]  {[/B]if (choice == 2)
        {
        int div([B]2[/B]);
        }
                                else
        [B] ([/B]choice != 3[B])[/B];
              [B]  {[/B]if (choice == 3)
        {
        int min([B]3[/B]);
        }
                                else
         [B]([/B]choice != 4[B])[/B];
               [B] {[/B]if (choice == 4)
        {
        int mul(4);
        }
        [B]cin.get();[/B]
}
                
                
int add()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 + n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}
                

int div()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 / n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

int min()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 - n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

int mul()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 * n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

Ok so instead of just removing things I went ahead and bolded stuff that is not needed or will cause it not to work. So from top to bottom you need to remove the constant from each and every function prototype. The constant is not needed and isn't used. I personally would declare n1, n2 and total as global variables only so you don't have to recreate them every time.

You don't need the boolean expressions. All you did there was set a boolean expression which was never used. Next remove the Curly brace before the if statements. Remove all the else statements. Replace the ifs after the first one with else if. Remove the Cin.get. The semi colons on the functions needs to be removed as you aren't calling them.


Should fix all the issues. Had to keep switching between two tabs and probably missed stuff.


Apparently I can't bold inside the code tags. Oh well it is wrapped with the bbcode.
Edited by CAxVIPER - 10/6/13 at 1:36pm
post #13 of 18
Thread Starter 
Quote:
Originally Posted by CAxVIPER View Post

Where to begin with that code. Well first off I went ahead and rewrote it so it works and corrected several errors. I assume you are just starting out.
Warning: Spoiler! (Click to show)
Code:


#include <iostream>
#include <string>
using namespace std;

int add();
int somethingelse();
int min();
int mul();

int n1, n2, total;

int main()
{
    int choice;
    cout << "Please select One Of the Following Options" << endl;
    cout << " \n";
    cout << "Press 1 For ADDING \n";
    cout << "Press 2 For DIVISION \n";
    cout << "Press 3 For SUBTRACTION \n";
    cout << "Press 4 For MULTIPLICATION \n";
    scanf("%d", &choice);
    if(choice == 1)
    add();
        else if(choice == 2)
            somethingelse();
    
        else if(choice == 3)
            min();
    
        else if (choice == 4)
            mul();
    
        else
            printf("Invalid selection");
    
    }

                    int add()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 + n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                
                int somethingelse()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 / n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                int min()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 - n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}
                
                int mul()
                {
                    cout << "Insert First Number:";
                    cin >> n1;
                    cout << "First Number Has Been Added. \n";
                    cout << "Insert Second Number:";
                    cin >> n2;
                    total = n1 * n2;
                    cout << "Second Number Has Been Added. \n";
                    cout <<  " The Answer Is " << " " << total << endl;
                    //system("pause");
                    return 0;}



If this is for homework or something please don't just copy what I did without understanding it as you will never get better.


Ok now back to your code
Code:
#include <iostream>
#include <string>
using namespace std;

int add([B]1[/B]);
int div([B]2[/B]);
int min([B]3[/B]);
int mul([B]4[/B]);

int main()
{
        char choice;
        cout << "Please select One Of the Following Options" << endl;
        cout << " \n";
        cout << "Press 1 For ADDING \n";
        cout << "Press 2 For DIVISION \n";
        cout << "Press 3 For SUBTRACTION \n";
        cout << "Press 4 For MULTIPLICATION \n";
        cin >> choice;
        [B] (choice != 1);[/B]
               [B] {[/B]if (choice == 1)
        {
        int add([B]1[/B]);
        }
                                else
      [B]   ([/B]choice != 2[B])[/B];
              [B]  {[/B]if (choice == 2)
        {
        int div([B]2[/B]);
        }
                                else
        [B] ([/B]choice != 3[B])[/B];
              [B]  {[/B]if (choice == 3)
        {
        int min([B]3[/B]);
        }
                                else
         [B]([/B]choice != 4[B])[/B];
               [B] {[/B]if (choice == 4)
        {
        int mul(4);
        }
        [B]cin.get();[/B]
}
                
                
int add()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 + n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}
                

int div()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 / n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

int min()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 - n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

int mul()[B];[/B]
{int n1, n2, total;
cout << "Insert First Number:";
cin >> n1;
cout << "First Number Has Been Added. \n";
cout << "Insert Second Number:";
cin >> n2;
total = n1 * n2;
cout << "Second Number Has Been Added. \n";
cout <<  " The Answer Is " << " " << total << endl;
//system("pause");
return 0;}

Ok so instead of just removing things I went ahead and bolded stuff that is not needed or will cause it not to work. So from top to bottom you need to remove the constant from each and every function prototype. The constant is not needed and isn't used. I personally would declare n1, n2 and total as global variables only so you don't have to recreate them every time.

You don't need the boolean expressions. All you did there was set a boolean expression which was never used. Next remove the Curly brace before the if statements. Remove all the else statements. Replace the ifs after the first one with else if. Remove the Cin.get. The semi colons on the functions needs to be removed as you aren't calling them.


Should fix all the issues. Had to keep switching between two tabs and probably missed stuff.


Apparently I can't bold inside the code tags. Oh well it is wrapped with the bbcode.

Thank you very much. I will look at your code line by line to understand what is going on. It looks like I was on the right track, but I had a few issues. Not bad for my first C++ attempt. Thanks buddy! thumb.gif

Edit: After checking the code, All I don't understand is the "scanf("%d", &choice);" line.
Edited by BradleyW - 10/6/13 at 2:52pm
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
post #14 of 18
scanf() extracts what ever is in the input stream, and uses parameters for different formats. d% is for decimal integer 0-9, &choice is where the data is being placed.
2009
(15 items)
 
   
CPUMotherboardGraphicsRAM
i7 920 4.0Ghz 1.20v golden? Asus p6x58D Premium 770gtx Windforce OC ocz gold 1600 8-8-8-24-74-1T 
Hard DriveCoolingOSMonitor
x25-m80G2 Black640 H100 GT AP-15s Windows 7 Pro. 64 bit Dell U2410 1920x1200 IPS 
PowerCaseAudio
corsair tx 850 antec 1200 SoundBlaster ZX 
CPUMotherboardGraphicsRAM
Intel i7 3720qm(ivy) 2.6 Sager GTX 670m 8 gig 
Hard DriveKeyboardPower
80gig mssd steel series Huge power brick 
  hide details  
Reply
2009
(15 items)
 
   
CPUMotherboardGraphicsRAM
i7 920 4.0Ghz 1.20v golden? Asus p6x58D Premium 770gtx Windforce OC ocz gold 1600 8-8-8-24-74-1T 
Hard DriveCoolingOSMonitor
x25-m80G2 Black640 H100 GT AP-15s Windows 7 Pro. 64 bit Dell U2410 1920x1200 IPS 
PowerCaseAudio
corsair tx 850 antec 1200 SoundBlaster ZX 
CPUMotherboardGraphicsRAM
Intel i7 3720qm(ivy) 2.6 Sager GTX 670m 8 gig 
Hard DriveKeyboardPower
80gig mssd steel series Huge power brick 
  hide details  
Reply
post #15 of 18
Thread Starter 
Quote:
Originally Posted by FlyingNugget View Post

scanf() extracts what ever is in the input stream, and uses parameters for different formats. d% is for decimal integer 0-9, &choice is where the data is being placed.

Thank you very much!
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
post #16 of 18
I think it is fine to use cin

Here is another way of building a calculator.
It requires slightly more from the user. Takes an expression from the user such as "25 / 2" and gives the result without a menu system.
Code:
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
// var for the calculation
double num1;
double num2;
double answer;

// var for getting input
char opr;
string exp;

cout << "enter an expression" << endl;
getline( cin, exp );// grabbing the whole line

stringstream ss( exp );
ss >> num1 >> opr >> num2;// spitting it out into variables


// do the calculation
if( opr == '+' )
answer = num1 + num2;

else if( opr == '/' )
answer = num1 / num2;

else if( opr == '-' )
answer = num1 - num2;

else if( opr == '*' )
answer = num1 * num2;

cout << "The total is: " << answer << endl;
}
2009
(15 items)
 
   
CPUMotherboardGraphicsRAM
i7 920 4.0Ghz 1.20v golden? Asus p6x58D Premium 770gtx Windforce OC ocz gold 1600 8-8-8-24-74-1T 
Hard DriveCoolingOSMonitor
x25-m80G2 Black640 H100 GT AP-15s Windows 7 Pro. 64 bit Dell U2410 1920x1200 IPS 
PowerCaseAudio
corsair tx 850 antec 1200 SoundBlaster ZX 
CPUMotherboardGraphicsRAM
Intel i7 3720qm(ivy) 2.6 Sager GTX 670m 8 gig 
Hard DriveKeyboardPower
80gig mssd steel series Huge power brick 
  hide details  
Reply
2009
(15 items)
 
   
CPUMotherboardGraphicsRAM
i7 920 4.0Ghz 1.20v golden? Asus p6x58D Premium 770gtx Windforce OC ocz gold 1600 8-8-8-24-74-1T 
Hard DriveCoolingOSMonitor
x25-m80G2 Black640 H100 GT AP-15s Windows 7 Pro. 64 bit Dell U2410 1920x1200 IPS 
PowerCaseAudio
corsair tx 850 antec 1200 SoundBlaster ZX 
CPUMotherboardGraphicsRAM
Intel i7 3720qm(ivy) 2.6 Sager GTX 670m 8 gig 
Hard DriveKeyboardPower
80gig mssd steel series Huge power brick 
  hide details  
Reply
post #17 of 18
Thread Starter 
Thank you for this alternate way. I will study the code more in depth tomorrow seen as C++ is all new to me.
+1 to all who helped.
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
X79-GCN
(22 items)
 
  
CPUMotherboardGraphicsRAM
Intel 3930K 4.5GHz HT GIGABYTE GA-X79-UP4 AMD R9-290X GEil Evo Potenza DDR3 2400MHz CL10 (4x4GB) 
Hard DriveCoolingCoolingCooling
Samsung 840 Pro 120GB EK Supremacy (CPU) NF F12's P/P (360 Rad)  NF A14's (420 Rad)  
CoolingCoolingCoolingCooling
XSPC Chrome Compression Fittings EK RES X3 150 Primochill PremoFlex Advanced LRT Clear 1/2 ID EK-FC (R9 290X) 
CoolingCoolingCoolingOS
EK D5 Vario Top-X  Phobya G-Changer V2 360mm Phobya G-Changer V2 420mm Win 10 x64 Pro 
MonitorKeyboardPowerCase
BenQ XR3501 35" Curved Corsair Vengeance K90 Seasonic X-1250 Gold (v2) Corsair 900D 
MouseAudio
Logitech G400s Senn HD 598 
  hide details  
Reply
post #18 of 18
CIN is fine I just started with C and carried over scanf and printf. It was definitely on the right track just needed a little work. You could even reduce it more but what I suggest is keep a copy of that then when you learn more go back and condense the code. See how small you can make it.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Make A Calculator In C++?