Hello today I felt like coding a (/,*) calculator. Every time I try to run this it doesn't work. Here's what I got so far.
using namespace std;
int main() { char rept; do {
int a;
int b;
int x;
int /;
int sum;
cout << "Type the number u want to be divided/multiplied! " << endl;
cout << "" << endl;
cin >> a;
cout << "Now type the # u want to divide/multiplied " << a << " by " << endl;
cout << "Now press (x) OR (/)" <<endl;
cin >> x;
cin >> /;
Cout << "Now press your second diget" << endl;
cin >> b;
cout << "Now the awnser is : " << sum << endl;
sum = a/b;
sum = a*b;
cout << "All credits go to Mrvinc911 " << endl;
cout << "press y or Y to use again " << endl;
cin >> rept;
cout <<"" << endl;
}
while (rept == 'y' || rept == 'Y' || rept == 'n'); return 0; }
Log in to post a comment.
Hello today I felt like coding a (/,*) calculator. Every time I try to run
this it doesn't work. Here's what I got so far.
include <iostream>
using namespace std;
int main()
{
char rept;
do
{
int a;
int b;
int x;
int /;
int sum;
cout << "Type the number u want to be divided/multiplied! " << endl;
cout << "" << endl;
cin >> a;
cout << "" << endl;
cout << "Now type the # u want to divide/multiplied " << a << " by " << endl;
cout << "" << endl;
cout << "Now press (x) OR (/)" <<endl;
cin >> x;
cin >> /;
Cout << "Now press your second diget" << endl;
cout << "" << endl;
cin >> b;
cout << "" << endl;
cout << "Now the awnser is : " << sum << endl;
sum = a/b;
sum = a*b;
cout << "" << endl;
cout << "All credits go to Mrvinc911 " << endl;
cout << "" << endl;
cout << "press y or Y to use again " << endl;
cout << "" << endl;
cin >> rept;
cout <<"" << endl;
}
while (rept == 'y' || rept == 'Y' || rept == 'n');
return 0;
}