• Register
Post tutorial RSS Simple C++ Calculator in Code::Blocks

C++ using Code::Blocks. Simple calculator in Console App.

Posted by on - Basic Client Side Coding

Here is a simple calculator in c++ using Code::Blocks for beginners. Start a new project, choose Console Application, follow the setup prompt. Once project is open, choose main.cpp and enter the following code, then build and run. This will ask for 2 numbers and add them together. Enjoy :)


#include <iostream>

using namespace std;

int main()
{
   int a;
   int b;
   int sum;

   cout << "Enter first num. \n";
   cin >> a;
   cout << "Enter second num. \n";
   cin >> b;
   sum = a+b;
   cout << "The sum is - " << sum << endl;
   return 0;
}
Comments
Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.