Source Code C/C++ 2 num. calculator

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
Hello people of GH!
I am releasing the code of an 2 num. calculator (duh), it is nothing special, you guys can do it with closed eyes but hey I am god damn proud of it!
We all have to start from somewhere, right?
Nuff' chit-chat here is the code:
C++:
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
	int x;
	int y;
	
	int xmx;
	xmx = 32600;
	int ymx;
	ymx = -32600;
	
	
	cout << "Pick a number you want to multiply." << endl;
	cin >> x;

	while (x > xmx)
	{
		cout << "Sorry, the number you entered is too high, pick another one." << endl;
		cin.clear();
		cin >> x;
	}
	
	while (x < ymx)
	{
		cout << "Sorry, that number is too low, pick another one." << endl;
		cin.clear();
		cin >> x;
	}
	
		cout << "Chose one more number." << endl;	
		cin >> y;	  													
		
	while (y > xmx)
	{
		cout << "Sorry,that number is too hing, pick another one." << endl;
		cin.clear();
		cin >> y;
	}
		
	while (y < ymx)
	{
		cout << "Sorry, that number is too low, please pick another one. " << endl;
		cin.clear();
		cin >> y;
	}
		
		cout << "You chose :" << x; 
		cout << " and " << y << endl;
		cout << "The end resuLt is: " << x*y << endl; 

		
	while (!GetAsyncKeyState(VK_F1) & 0x1); //c5's work!
		
		return 0;
}
Also thanks to TBA for helping me with while loops
 

Alex

Sober linux neb
Dank Tier Donator
Nobleman
Nov 26, 2015
150
828
1
Good content for newbies! Thanks for sharing :)

P.S: Good work!
 

tvojama

uz42&4fd
Meme Tier VIP
Dank Tier Donator
Apr 1, 2015
377
2,498
10
Thanls for the feedback guys!
My next goal is to block the letter input, as it crashes the console (I'm adding stuff as I learn)
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Thread starter Similar threads Forum Replies Date
WiTH how to make a simple c++ calculator C / C++ Coding and Game Hacking 5

Similar threads

Community Mods