I Love You Print in 100 times JAVA code

 import java.util.Scanner;

public class WhileLoop {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int counter = 1;

        while (counter <= n) {

            System.out.println("I Love You " + counter);

            counter++;

        }

        System.out.println(n + " times I love you print.");

    }

}


No comments:

Post a Comment

Max Sub Array Sum: Kadane's Algorithm

Code of: Max Sub Array Sum: Kadane's Algorithm. public class MaxSubArraySumKadanesALgorithm {     public static void Kadane ( int ...