Indie game developers in Unity3D. C-Sharp and Javascript game programming, primarily C-Sharp. 2D physics based games, 3D FPS, MMORPG, Puzzle, and many other genres in near future. Android, PC, Mac, iOS, Linux, Web, Chrome platforms.

Report 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;
}
Post comment Comments
Guest
Guest - - 689,470 comments

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

Guest
Guest - - 689,470 comments

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

Guest
Guest - - 689,470 comments

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

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: