Multiplying Calculator C++

Posts 1–12 of 12 · Page 1 of 1
Multiplying Calculator C++
So I'm trying to learn about C++ and integers. I decided a good way to learn is to attempt to make a calculator that does some type of mathematical operation.

I succeeded!
I thought it was kinda cool so why not release the .exe and source to MPGH.

@Symmetrical
Please approve.

Thanks' are always appreciated!






Virus Scans

 
VirusTotal 2/54
https://www.virustotal.com/en/file/134ab43022e6f842e08cb7ed9e164028df3bca8c5b72a62018 8638bab9fab0a2/analysis/1403674631/


 
Source Code

#include <iostream>


using namespace std;


int main()

{
int a;

int b;

int c;

cout << "Please input the first number you would like to multiply : ";
cin >> a;
cin.ignore();

cout << "Please input the second number you would like to multiply : ";
cin >> b;
cin.ignore();


c = a * b;
cout << c;


return 1;


}


Here's the download to the .exe
 
Download


C++ Calc._mpgh.net.zip254 KB · 24 downloads 2/54 malicious
This won't change anything but instead of typing
int a;
int b;
int c;
you can typ int a, b, c;
Quote Originally Posted by jompan18 View Post
This won't change anything but instead of typing
int a;
int b;
int c;
you can typ int a, b, c;
@jompan18
Thanks!
Like I said I'm new to C++ so any tips like that are much appreciated.
Quote Originally Posted by jompan18 View Post
This won't change anything but instead of typing
int a;
int b;
int c;
you can typ int a, b, c;
However, if somewhere along the line you decide you need b to be an unsigned int you have to take all that pretty shit apart again.
And you're more likely to do char *pPointer, pYourmam by accident. pYourmam will be a normal char instead of a char pointer.
I personally prefer keeping everything on seperate lines due to the above mentioned reasons.
Quote Originally Posted by Hell_Demon View Post
However, if somewhere along the line you decide you need b to be an unsigned int you have to take all that pretty shit apart again.
And you're more likely to do char *pPointer, pYourmam by accident. pYourmam will be a normal char instead of a char pointer.
I personally prefer keeping everything on seperate lines due to the above mentioned reasons.
if you put everything on its own line, it'll still be safe tho.

IE:

Code:
char * pPointer,
       * pYourMom;
Great job, remember that practice makes perfect.

Quote Originally Posted by Hero View Post
Approved .
SUP LANCE
Quote Originally Posted by Gab View Post
Great job, remember that practice makes perfect.



SUP LANCE
/omfg GAB WHERE U BEEN
Quote Originally Posted by Hero View Post
/omfg GAB WHERE U BEEN
Nigga I can't private message you wat do
Good job man, you're getting there, not make a full function calculator :P
You could've done this way:
Code:
int a, b;
cout << "Type the numbers you want to mutiply: " << endl;
cin >> a >> b;
cout << "Result: " << a * b;
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?