Wap to accept a number, if a number is even print it’s half otherwise double
Answers
Answered by
4
Answer:
Integers which are perfectly divisible by 2 are called even numbers.
And those integers which are not perfectly divisible by 2 are not known as odd number.
To check whether an integer is even or odd, the remainder is calculated when it is divided by 2 using modulus operator %. If remainder is zero, that integer is even if not that integer is odd.
Answered by
0
Answer:
int a;
if (a%2==0)
{
printf (a/2);
}
else {
printf (a*2)
}
Similar questions