Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mng2023b5;
- import java.util.Scanner;
- public class Day09B {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int count = 0;
- String txtIn="", txtResult="";
- while (count < 7) {
- System.out.println(count);
- count++;
- }
- // all the loop need is a condition
- // if you have a way to trigger it like in
- // an if else statement then you can use it
- System.out.println("enter words(type x to end:");
- while (txtIn.equalsIgnoreCase("x") == false) { // kelangan reverse condition
- txtIn = sc.nextLine();
- txtResult += txtIn + " ";
- }
- System.out.println(txtResult.toUpperCase());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment