#include <iostream>
using namespace std;
int
main ()
{
int number1, number2, sumatotala, choose, add, multiply;
add = "add";
multiply = "multiply";
cin>>choose;
cin>>number1;
cin>>number2;
if(choose = add) cout<<number1+number2;
if(choose = multiply) cout<<number1*number2;
return 0;
}
This is my code and I have the next error. main.cpp:17:9: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] add = "add"; ^~~~~ main.cpp:18:14: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] multiply = "multiply"; ^~~~~~~~~~
I want to make a little program that lets u choose multiply or add and based on your decision multiply or add the 2 numbers. I don't code that well and if someone could help me I would be very gratefull.