Calculator question

#include
using namespace std;

int main()
{
char character;
cin>>character;
bool ans= false;

if (character=='*')
{
	bool ans=true;
	int N1,N2;
	cin>>N1;
	cin>>N2;
	int product= (N1*N2);
	cout<<product;	
}
else if (character=='+')
{
	bool ans=true;
	int N1,N2;
	cin>>N1;
	cin>>N2;
	int sum=N1+N2;
	cout<<sum;
}
else if( character== '-'){
	bool ans=true;
	int N1,N2;
	cin>>N1;
	cin>>N2;
	int difference=(N1- N2);
	cout<< difference;
}
else if (character== '/')
{
	bool ans=true;
	int N1,N2;
	cin>>N1;
	cin>>N2;
	float division=(N1/N2);
	cout<<division;
}
else if (character== '%')
{
	bool ans=true;
	int N1,N2;
	cin>>N1;
	cin>>N2;
	int remainder= (N1%N2);
	cout<<remainder;
}
else if (character=='x' || character=='X')
{
	bool ans=true;
}

if (ans=false)
{
cout<<“invalid”<<endl;
}

return 0;

}
// no test case coming successful but getting the answer on running the code

hi @srivastavaayush1611_3fd51b257da0b834, updated

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.