Monday, 27 October 2014

Write a program that asks the user to type in two integer values at the terminal. Test these two numbers to determine if the first is evenly divisible by the second and then display an appropriate message at the terminal.

Leave a Comment

Code-:

#include<iostream>
using namespace std;
void main()
{
int number=0,number2=0;
cout<<"Enter Number 1 and Number 2 = ";
cin>>number>>number2;
if(number%number2==0)
{
cout<<"This is evenly divisible by the Second"<<endl;
}
else
cout<<"This is not evenly divisble by the second"<<endl;
system("pause");

}

Output-:


If You Enjoyed This, Take 5 Seconds To Share It