11-13-2013, 12:46 PM
XD
I found out what Xcode was, so i switched to c++ :IIIII here is my first code if you want it xDD
#include <iostream>
using namespace std;
int main()
{
label:
int x;
int y;
int function;
cout << "Welcome to my crappy calculator " << endl;
cout << "this is my first program!" << endl;
cout << "also this is made for the understandment of math operators " << endl;
cout << " choose your function!" << endl;
cout << "1.)Addition 2.)Subtraction 3.)Multiply 4.)Divison" << endl;
cin >> function;
cout << "you have choosen " << function << ". function " << endl;
cout << "give me 1 number" << endl;
cin >> x;
cout << "You have chosen " << x << " As your first number! please enter your second number!" << endl;
cin >> y;
if(function == 1){
int sum = x + y;
cout << "the result of that is " << sum << endl;
}
if(function == 2){
int sum = x - y;
cout << "the result of that is " << sum << endl;
}
if(function == 3){
int sum = x * y;
cout << "the result of that is " << sum << endl;
}
if(function == 4){
int sum = x / y;
int sumdiv = x % y;
cout << "the result of that is " << sum << " with a rest of " << sumdiv << endl;
}
goto label;
return 0;
}
I found out what Xcode was, so i switched to c++ :IIIII here is my first code if you want it xDD
#include <iostream>
using namespace std;
int main()
{
label:
int x;
int y;
int function;
cout << "Welcome to my crappy calculator " << endl;
cout << "this is my first program!" << endl;
cout << "also this is made for the understandment of math operators " << endl;
cout << " choose your function!" << endl;
cout << "1.)Addition 2.)Subtraction 3.)Multiply 4.)Divison" << endl;
cin >> function;
cout << "you have choosen " << function << ". function " << endl;
cout << "give me 1 number" << endl;
cin >> x;
cout << "You have chosen " << x << " As your first number! please enter your second number!" << endl;
cin >> y;
if(function == 1){
int sum = x + y;
cout << "the result of that is " << sum << endl;
}
if(function == 2){
int sum = x - y;
cout << "the result of that is " << sum << endl;
}
if(function == 3){
int sum = x * y;
cout << "the result of that is " << sum << endl;
}
if(function == 4){
int sum = x / y;
int sumdiv = x % y;
cout << "the result of that is " << sum << " with a rest of " << sumdiv << endl;
}
goto label;
return 0;
}