Untitled

                Never    
Java
       
import java.util.Scanner;

public class main5 {
    public static void main(String[] args) {
// 2.ב.9         
//        כתוב תוכנית הקולטת מהמשתמש תווים עד אשר מוקלדים ברצף 9 להניח שבקלט רק אותיות קטנות)
        Scanner s = new Scanner(System.in);
        int counter =0;
        char lastChar =0;
// loop that takes char until 3 consistsnt
// last char compare (+1) to your char - then get thevalu of your char to see next time in the loop the compare        
        do {
            System.out.println("please enter char");
            char yourChar = s.next().charAt(0);
            if (lastChar +1  == yourChar){
                counter++;
            }
            lastChar=yourChar;
        }
        while (counter!=2);
    }
}

Raw Text