wap to input any number and check whether it is multiple of 2 or not (c++)
Answers
Answered by
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:
![](https://hi-static.z-dn.net/files/dac/777ae6d007e6bcedc59c594d41c3f369.jpg)
![](https://hi-static.z-dn.net/files/dbe/da4b25a7212afeb8019cb7701ca63199.jpg)
Similar questions
Math,
2 months ago
Computer Science,
2 months ago
Chemistry,
2 months ago
Social Sciences,
3 months ago
Geography,
11 months ago
Math,
11 months ago