Computer Science, asked by kaustubhrathore16, 4 months ago

Wap to accept a number, if a number is even print it’s half otherwise double

Answers

Answered by Legend42
4

Answer:

\huge\boxed{\fcolorbox{blue}{orange}{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.

 {\huge{\sf{\blue{\underline {\underline {⚠ƒοℓℓοω ↯}}}}}}

Answered by abdullah264733
0

Answer:

int a;

if (a%2==0)

{

printf (a/2);

}

else {

printf (a*2)

}

Similar questions