C++ : read two numbers and checks whether first is multiple of second


#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int a,b;
cout<<"Enter any two numbers (a,b) : ";
cin>>a>>b;
if(a%b==0)
cout<<a<<" is multiple of "<<b;
else
cout<<a<<" is not multiple of "<<b;
getch();
return(0);
}

No comments:

Post a Comment