Answer:
This program has been written using JAVA. The code is written beloe:
// import library
import java.util.Scanner;
public category Main operate
public static void main(String[] args)
{
// scanner category
Scanner scan=new Scanner(System.in);
System.out.println("Enter Number:");
int n=scan.nextInt();
//All squares but n
System.out.println("All squares but n are: ");
int temp=0,square=0,i=0;
while(square
range
square=i*i;
if(square>=n)break;
System.out.print(square+" ");
i++;
}
//All positive numbers that are divisible by 10 but less than n
System.out.println(" ");
System.out.println(" ");
System.out.println("All positive numbers are divisible by 10 and less than n are: ");
i=1;
while(i
{
if(i%10==0)
System.out.print(i+" ");
if(i>=n)break;
i++;
}
System.out.println(" ");
System.out.println(" ");
System.out.println("All powers of 2 that are less than n are: ");
//All powers of 2 less than n
i=0;
while(i
mathematics.pow(2, i);
if(num_power
System.out.print(num_power+" ");
i++;
}
}
}
Explanation:
With SimpleWriter out and int n already declared in each case this program makes use of a while loop condition to satisfy the following;
1. All squares less than n
2. positive numbers that are divisible by 10 and less than n.
3. All powers of two less than n.