To Find Even
or Odd Number and Multiple C Plus Plus Program
Find
the number is even or odd using C++ program
And
also
Find
that two numbers are multiples of each other or not using C++ program
Scenario
This
program will ask the user to enter a number to find even or odd. When user will
enter the number, this program will tell the user that it is even or odd.
Then
this program will ask the user to enter two numbers to find out that they are
multiple of each other or not. User will enter the numbers and program gave its
decision that these numbers are multiples of each other or not.
C ++ Program
To Find Even
or Odd Number and Multiple
Program Code
//softoset.blogspot.com
#include<iostream>
using
namespace std;
int
main()
{
int a,b,c;
cout<<"Enter the integers
to find even odd\n";
cin>>a;
if(a%2==0)
cout<<a<<" is EVEN"<<endl;
else
cout<<a<<" is Odd"<<endl;
cout<<"Enter two number
to find the multiple \n";
cin>>b>>c;
if(b%c==0)
cout<<b<<"is the
Multi ple of "<<c<<endl;
else
cout<<b<<"is
not the Multi ple of "<<c<<endl;
return 0;
}
C ++ Program
To Find Even
or Odd Number and Multiple
Program
Output
The
above program yields the output as under.
Thank
you for trusting SoftOSet.
Post a Comment
Feel Free to Comment Us