Build a calculator with C++

Create your App

Select File→New →Project to open the dialogue. Then you’ll want to open the C++ templates node on the left and choose Windows Console Application. Rename it as “CalculatorTutorial” then OK.

Create your project

In your CalculatorTutorial.cpp file, add the following highlighted code:

// CalculatorTutorial.cpp : Defines the entry point for the console application. 
//

#include "stdafx.h"
#include <iostream>  

using namespace std;  
  
int main()  
{  
    cout << "Calculator Console Application" << endl << endl;   
    cout << "Please enter the operation to perform. Format: a+b | a-b | a*b | a/b" << endl; 
    return 0;  
}



To run the application, press Ctrl + F5 or go to the Debug menu and choose Start Without Debugging. If you get a “This project is out of date” pop-up, click Yes. You should see the following terminal window pop up:

First launch

Close the terminal window when you are done.


I ran into an issue Continue tutorial