Computer Science, asked by granitebala, 8 months ago

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 Lakshithavijay
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