write a program to display given entered number is even using if??in putty
Answers
Answered by
1
Answer:
Hi!
I want to help you. You did not mention the programming language to be used. Since I am very good in Java, I am writing the Java source code.
import java.uti.*; //using util class
class number
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in); //scanner object
System.out.println("Enter a number=");
int n=sc.nextDouble();
if(n%2==0)
System.out.println("The Number you entered is even");
else
System.out.println("The Number is odd");
}
}
#answerwithquality & #BAL
Similar questions