Computer Science, asked by manshutaashi73, 1 day ago

Draw a flowchart to input a name and print “The name is Kabir” if the input is Kabir, and print “The name is Sameer” if the input is Sameer. Write an apt default condition too.

Answers

Answered by samarthkrv
4

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 Scanner scanner = new Scanner(System.in);

 System.out.print("Enter name:");

 String name = scanner.nextLine();

     if(name.equalsIgnoreCase("Kabeer"))

         System.out.println("The name is Kabeer");

     else if(name.equalsIgnoreCase("Sameer"))

         System.out.println("The name is Sameer");

     else    

         System.out.println("The name is " + name);

     

}

}

Explanation:

Similar questions