Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java yes or no loop

import java.util.Scanner;

public class Temperature
{
 public static void main(String[] args){

    Scanner input = new Scanner (System.in);
    do{
    
    
     System.out.println("Would you like to continue?(yes/no)");
        prompt = input.next();
    }while(prompt.equalsIgnoreCase("yes")); 
  }
 }
 
PREVIOUS NEXT
Tagged: #java #loop
ADD COMMENT
Topic
Name
8+4 =