Menu

(Solved) : Change C Code User Prompt Y N Instead 1 Continue Include Using Namespace Std Bool Ismulitp Q37225903 . . .

Change this C++ code so the user is prompt with(Y or N) instead of 1 to continue.

#include <iostream>

using namespace std;
bool isMulitple(int n1,int n2){
return n1%n2==0;
}
int main()
{
int c=1;
int n1,n2;
while(c==1){
cout<<“Enter 2 numbers: “;
cin>>n1;
cin>>n2;
if(isMulitple(n1,n2))
cout<<n1<<“,”<<n2<<” are mulitples of eachothern”;
else
cout<<n1<<“,”<<n2<<” are not mulitple ofeach other n”;
cout<<“Press 1 to continue ,any other key to exit: “;<—– Change this to (Y or N)prompt
cin>>c;
}
}

Expert Answer


Answer to Change this C++ code so the user is prompt with (Y or N) instead of 1 to continue. #include using namespace std; bool is…

OR