
Hello. I need help with the following.
Write a program that prompts the user for 2 different integers, then prints out the numbers between the 2 integers (inclusive) and their squares and the sum of their squares. Use a loop.
Print out the following- be sure to use loop.
* ** *** **** ***** ****** ***** **** *** ** *
Thanks in advance.

import java.util.*;
class NumberExample1
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("Enter Number1: ");
int num1=input.nextInt();
System.out.print("Enter Number2: ");
int num2=input.nextInt();
int sum=0;
System.out.println("Number Square");
for(int i=num1+1;i<num2;i++){
System.out.println(i+"\t"+(i*i));
sum+=(i*i);
}
System.out.println("Sum of squares: "+sum);
}
}

public class Pattern {
public static void main(String[] args) {
for(int i=1;i<=6;i++){
for(int j=1;j<=i;j++){
System.out.print("*");
}
System.out.println();
}
for(int i=6;i>=1;i--){
for(int j=1;j<i;j++){
System.out.print("*");
}
System.out.println();
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.