"choice" undeclared(first use this function)
Write your question here.
I keep getting "choice" undeclared(first use this function)for line 28.. please tell me what the problem is
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#include <cstdlib>
#include <iostream>
using namespace std;
float addition(float num1, float num2)
{
return num1 + num2;
}
float sutraction(float num1, float num2)
{
return num1 - num2;
}
float multiplication(float num1, float num2)
{
return num1 * num2;
}
float division(float num1, float num2)
{
return num1 / num2;
}
int main(int argc, char *argv[])
{
float number1;
float number2;
int coice;
cout << "Choose your operation. 1 = Adding. 2 = Sutraction. 3 = Multiplication 4 = Division" << endl;
cout << "choice: ";
cin >> choice
if(choice==1)
{
//Addition
cout << "You are adding. Enter the first number you would like to add \n Number 1: ";
cin >> number1;
cout << "Enter the second number. \n Number 2: ";
cout << "The answer is: " << addition(number1, number2) << endl;
}
else
{
if(choice==2)
{
}
.
|
Line 27 is your problem coice isn't choice
Topic archived. No new replies allowed.