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 › Basic Homework helper

Basic Homework helper

Posts 1–3 of 3 · Page 1 of 1
AG
AGWStge5rya$@%
Basic Homework helper
So, my friend asked me to come up with a program that does basic math problems. (Multiple, Divide, Add,Subtract)
I can make a single one work, but I don't want to make four projects.
I wanted to put it into one project.
So, I was messing around, and this is what I got so far, it shows both answers, and I only want it to show the answer I asked for.
Code:
/*Homework finisher
*/
#include <cstdio>

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

int main(int nNumberofArgs, char* pszArgs[])
{
int x;
    cout << "Enter the first number of your problem:";
    cin >> x;



    int y;
    cout << "Enter the second number of your problem:";
    cin >> y;

int divider;
cout << "1 for Divide, 2 for multiply, 3 for addition, 4 for subtraction";
cin >> divider;
if (1);
int result1;
result1 = x / y;

if (2);
int result2;
result2 = x * y;

if (1)
cout << "Answer is:";
cout << result1 <<endl;

if (2)
cout << "Answer is:";
cout << result2 <<endl;

system("PAUSE");
    return 0;
}
#1 · 15y ago
Hell_Demon
Hell_Demon
Code:
cin >> divider;
if (divider == 1)
{
    int result1;
    result1 = x / y;
    cout << "Answer is:";
    cout << result1 <<endl;
}
else if (divider == 2)
{
    int result2;
    result2 = x * y;
    cout << "Answer is:";
    cout << result2 <<endl;
}
Might want to dive back into your C++ book(s) cause this is really basic stuff ._.
#2 · edited 15y ago · 15y ago
AG
AGWStge5rya$@%
I know. :P
Thanks tho. =D
#3 · 15y ago
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

  • Basic SignatureBy Chronologix in Tutorials
    68Last post 19y ago
  • Basic AnimationBy Chronologix in Tutorials
    29Last post 18y ago
  • Packets & Visual BasicBy BadBob in Hack Requests
    5Last post 20y ago
  • [Help] Atom API with Visual Basic 6.0 or .NETBy Bull3t in Visual Basic Programming
    5Last post 20y ago
  • Basic Codecaves with FEAR as an example.By Zededarian in Game Hacking Tutorials
    0Last post 20y ago

Tags for this Thread

None