Computer Science, asked by ujjwalkumarbgpg6, 2 months ago

wap to input any number and check whether it is multiple of 2 or not (c++)​

Answers

Answered by anindyaadhikari13
1

Solution:

The given problem is solved using C++

#include <iostream>

using namespace std;

int main() {

   int n;

   cout<<"Enter an integer number: ";

   cin>>n;

   if(n%2==0)

       cout<<"Number is a multiple of 2.";

   else

       cout<<"Number is not a multiple of 2.";

   return 0;

}

Explanation:

  • A number is said to be a multiple of 2 if it is divisible by 2.
  • Here, we will check if the number is divisible by 2 or not. If true, the number is a multiple else not.

See attachments for output.

Attachments:
Similar questions