please friends answer faster
write a program in java to ask input and write 1 as male and 2 as female and 3 as invalid.
marking of brainliest will be done.
Answers
Answered by
1
import java.util.*;
public class program
{
public static void main (String args[])
{
System.out.println("Enter a number:");
int a = in.nextInt();
{
if (a==1)
System.out.println("Female");
if(a==2)
System.out.println("Male");
if(a==3)
System.out.println("Invalid");
}
}
}
Similar questions
Math,
4 months ago
Environmental Sciences,
8 months ago
Physics,
11 months ago
Chemistry,
11 months ago