
write an application that prints every integer value from 1 to the number specified by the user along with the squared value of each integer.

Hi Friend,
Try this:
<html>
<h3>Sqaure of Numbers</h3>
<script>
var n=window.prompt("Enter the value of n: ");
var i=1;
var sq;
for(i=1;i<=n;i++){
sq=i*i;
document.write(i+": "+sq+"<br>");
}
</script>
</html>
Thanks

Hi Friend,
If you want this in java then try this:
import java.util.*;
class SquareNumber
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("Enter the value of n: ");
int n=input.nextInt();
System.out.println();
System.out.println("No Square");
for(int i=1;i<=n;i++){
int sq=i*i;
System.out.println(i+" "+sq);
}
}
}
Thanks
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.