hi all. i was making a calculator program last night. i use dev c++ bloodshed, and its really picky on certain things. well, this program isnt working, and i cant seem to find out why. can any of u plz help me?! thx alott..
btw, i am on a mac computer at school, and have the coding on a floppy. mac isnt lettin me copy n' paste, so i cant do the code]....[/code] statement. srry...and disregard those squares at the start of each line...macs are so dumb!
Code:#pragma hdrstop #include <iostream.h> #include <conio.h> void main() { int var1 int var2 int var3 int var4 int choice1 int choice2 int Answer1 int Answer2 do { cout << "\nHello, do you want to add or subtract numbers? (a/s)"; cin >> choice1; if ( choice1 == 'a' ) { cout << "\nPlease enter the first number and second number, to be added, seperated by a space: "; cin >> var1; cin >> var2; Answer1 = var1 + var2 cout << "\nThe answer is " << Answer1; } if ( choice1 == 's' ) { cout << "\nPlease enter the first number and second number, to be subtracted, seperated by a space: "; cin >> var3; cin >> var4; Answer2 = var3 + var4 cout << "\nThe answer is " << Answer2; } cout << "\nDo you want to do this again? (y/n)"; cin >> choice2; } while ( choice2 != 'n' ) getch() }



LinkBack URL
About LinkBacks
and disregard those squares at the start of each line...macs are so dumb!


