Question 20. Programme to check First number is the factor of Second number or not.
Question 20. Programme to check First number is the factor of Second number or not.
using namespace std;
int main()
{
int Num1 = 0, Num2 = 0;
cout << "Enter the first Number :";
cin >> Num1;
cout << "Enter the second Number:";
cin >> Num2;
if(Num2%Num1==0)
{
cout<< "First Number is the factor of Second Number";
}
else
{
cout <<"First Number is not the factor of Second Number";
}
return 0;}
using namespace std;
int main()
{
int Num1 = 0, Num2 = 0;
cout << "Enter the first Number :";
cin >> Num1;
cout << "Enter the second Number:";
cin >> Num2;
if(Num2%Num1==0)
{
cout<< "First Number is the factor of Second Number";
}
else
{
cout <<"First Number is not the factor of Second Number";
}
return 0;}
No comments: