Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › How to make a Basic Addition Calculator + Explenation

How to make a Basic Addition Calculator + Explenation

Posts 1–5 of 5 · Page 1 of 1
PH
phoenixraider
How to make a Basic Addition Calculator + Explenation
First you go make a new Wind32 Console EMPTY Project.
Then,
You create a new file in the project (.cpp) and name it main.cpp.
When you click on your main.cpp file .. it should be blank.
If not , you did something wrong.

Lets start with the coding.

At the top include windows.h like this.
Code:
#include <windows.h>
This is an important part.You must specify to your compiler that you want to be using name space STD.So you do it like this below the #include.

Code:
 using namespace std;
Now we need to get our function because all coding must be in a function or it will give you errors.

Type in ..



Code:
int Main(void)

{

     return 0;
}
Now to add a Name to your Window you will have to do it like this.



Code:
system("TITLE Tutorial - 101");
Now that will make your window be named ..Tutorial - 101

Lets say you don't like the font or the background your window has and you want to change it.You do the following:



Code:
system("COLOR 1f");
The 1 stands for the color that you want your FONT to be.The f stands for the color that you want your BACKGROUND to be.

Now if you did it correctly .. you should have no errors and be ready to move to the next step.

Now you want to define our 2 variables.You may call them what ever you like but for this tutorial I will be using firstv and secondv.To do that in C++ you must do the following.



Code:
double firstv;
double secondv;
Now we need to make it print some text that asks you for your first Variable.How to do it ? :O Easy. You will use cout to do it.Like this:


Code:
cout << "Please enter the first number:" << endl << endl;
Now that will print the text , Please Enter the first number .I added the endl after so its not all cramed.endl stands for End Line.

Now we want it to remember the number that will be inputed.We will store it in our first variable that you defined above.Like this:



Code:
cin >> firstv;
That will save the number that you type (must be an element of N) into firstv.So when we call firstv it will use the number that you inputed

Now you do the same thing that you did for it to print the first number but now you want it to print this, Please enter the second number: I won't explain this line of code since I already did above.



Code:
cout << "Please enter the second number:" << endl << endl;
After doing that , you want to do same thing as above again.To input the number typed in there in secondv.Like this:



Code:
cin >> secondv;
I won't explan that line since I explained it before.

Now if you followed closely you shouldn't have any errors.If you do , then redo the tutorial.

Next step,

Here is where the real math will be done

First you want to print your text saying , The answer is:

Then let the program do the math like this.


Code:
cout << "The answer is:" << (firstv + secondv) << endl << endl
The real math is this .. (firstv + secondv) ... There is nothing else that does math in this whole code just that little thing.



now remember .. you must put all that in ..



Code:
int Main(void)

{

 

       return 0;

}
Tutorial was written by Str1k3r21 A.K.A. PhoenixRaider
If you release this on other sites give me credits.
#1 · 17y ago
TO
tokie_
i wear man im not tring to flame on you or anything but you need to rember to include
#include <iostream>
that is for your baisc input out put header you
cout stands for console output and cin for console input

but i guess it really depends on what version of C++ their using how their going to compile it and how their going to run the exe file
#2 · 17y ago
TH
therofl
Quote Originally Posted by tokie_ View Post

but i guess it really depends on what version of C++ their using how their going to compile it and how their going to run the exe file
Idk if thats the case, if you dont include iostream you cant use cout or cin at all.
#3 · 17y ago
PH
phoenixraider
I know it is iostream ..
But I did a typo and now it wont let me edit my first post


and yes u can use it without having put
Code:
#include <iostream>
Like this ...
Code:
std::cout
std::cin
std::endl
like dat ..
#4 · 17y ago
CA
Calster
Im sure using std::cout just makes it so you dont need to put
Code:
using namespace std;
I think you will always need:
Code:
#include <iostream>
to use cout and cin.

~Calster~
#5 · 17y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • How I make wallhack?By RaidenDXX in WarRock - International Hacks
    6Last post 20y ago
  • How to make a ZombieBy arunforce in Art & Graphic Design
    2Last post 20y ago
  • How to make the server runBy wowhaxor in Gunz General
    3Last post 20y ago
  • How to make a working NFV HackBy System79 in Game Hacking Tutorials
    1Last post 20y ago
  • How to make a game?By Dave84311 in General
    4Last post 20y ago

Tags for this Thread

#addition#basic#calculator#explenation#make