how can I tell the compiler a number is odd or even ?
Write a conditional statement that evaluates whether the value for a number property is odd or even. If the number is even, print "The number is even", otherwise, print "The number is odd".
Ask coding questions
Write a conditional statement that evaluates whether the value for a number property is odd or even. If the number is even, print "The number is even", otherwise, print "The number is odd".
in many langueges use the following steps:
for example java:
int num;
if (num%2==0)
System.out.println("even");
else
System.out.println("odd");