It tells me that line 29 (the highlighted part) hasnt declared "cin" ([Error] 'cin' was not declared in this scope)
I'd really like some help please.
#include <iostream>
#include <cstdlib>
float addition(float num1, float num2)
{
return num1 + num2;
}
float subtraction(float num1, float num2)
{
return num1 - num2;
}
float multiplikation(float num1, float num2)
{
return num1 * num2;
}
float division(float num1, float num2)
{
return num1 / num2;
}
int main()
{
float num1;
float num2;
float choice;
cout << "What would you like to do? \n 1= addition \n 2= subtraction \n 3= multiplikation \n 4= division";
cout << "choice: ";
cin >> choice;
if(choice==1)
{
//addition
cout << "You're adding, enter the first number you would like to add. \nNumber1: ";
cin >> num1;
cout << "Now enter the second number. \nNumer2: "
cin >> num2;
cout << "The answer is: " << addition(num1, num1) << endl;
}
else
{
if(choice==2)
{
//subtraction
cout << "You're subtracting, enter the first number you would like to subract. \nNumber1: ";
cin >> num1;
cout << "Now enter the second number. \nNumer2: "
cin >> num2;
cout << "The answer is: " << subtraction(num1, num1) << endl;
}
else
{
if(choice==3)
{
//multiplikation
cout << "You're multiplying, enter the first number you would like to multiply. \nNumber1: ";
cin >> num1;
cout << "Now enter the second number. \nNumer2: "
cin >> num2;
cout << "The answer is: " << multiplikation(num1, num1) << endl;
}
else
{
if(choice==4)
//division
cout << "You're dividing, enter the first number you would like to divide. \nNumber1: ";
cin >> num1;
cout << "Now enter the second number. \nNumer2: "
cin >> num2;
cout << "The answer is: " << division(num1, num1) << endl;
}
}
return 0;
}