Hi,
I have just started self-learning vc++.
I want to show output "true" instead of 1 and "false" instead of 0.
I searched in the forums for getting an hint but invain...Please helpp??
My code is
//minor problem showing 1 or 0 rather than true or false//
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
int multiple(int,int);//funcn prototype
char main()
{
int num,num1;
cout<<"Enter 1st number"<<endl;
cin>>num;
cout<<"enter 2nd number"<<endl;
cin>>num1;
cout<<"second is multiple of first number"<<endl;
cout<<multiple(num,num1);
return 0;
}
int multiple(int x,int y)//funcn defn
{
int result;
char a;
if((y%x)==0) //to find even no.
{
result=true;
a=static_cast<char>(result);
//converting it into char
cout<<"true"<<endl;
}
else if((y%x)!=0)
{
result=false;
a=static_cast<char>(result);
//converting it into char
cout<<"false"<<endl;
}
return a;
}