multiples or not

Write a C++ that inputs two numbers. It should print whether the two numbers are multiples or not.

#include<iostream>
using namespace std;
int main(){
	int a,b;
	cout<<"Enter two numbers "<<endl;
	cout<<"a : ";
	cin>>a;
	cout<<"b : ";
	cin>>b;
	if(a%b==0 || b%a==0){
		cout<<"Multiple";
	}
	else{
		cout<<"Not Multiple";
	}
}
numbers are multiple
numbers are multiple
numbers are not multiples
numbers are not multiples

One Reply to “multiples or not”

Leave a Reply

Your email address will not be published. Required fields are marked *