루프

    021 - For Loops 3

    021 - For Loops 3

    Write a for loop that will loop through every character of a word and print out each character, each on a separate line Sample inputs/outputs: In: hello h e l l o 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; class Main { public static void main(String[] args) { Scanner inp = new Scanner(System.in); System.out.print("In:"); String word = inp.nextLine(); //write your code below..

    020 - For Loops 2

    020 - For Loops 2

    Write a for loop that will print out the numbers starting at 1 and ending at twice the end number exclusive. Each number should be on the same line, separated by a space. Sample inputs/outputs: In: 5 0 1 2 3 4 5 6 7 8 9 In: 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 In: -5 (no output) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import java.util.Scanner; class Main { public static void..