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:
Similar questions
Math,
1 month ago
English,
1 month ago
Social Sciences,
2 months ago
Geography,
9 months ago
Math,
9 months ago