Series 0.1, 0.11, 0 .111,......
WAP to print the sequence 0.1, 0.11, 0.111 ............
import java.util.Scanner;
class Series3
{
public static void main()
{
System.out.println("Enter the number upto which you want the Sequence");
Scanner in = new Scanner(System.in);
int x = in.nextInt();
double a=0.1;
for(int i=1;i<x;i++)
{
System.out.print(a+", ");
a= a+ Math.pow(10,(-i-1));
}
System.out.print((a)+". ");
}
}
For Any Desired Program comment below. WE WILL TRY OUR BEST TO MAKE THAT PROGRAM AVAILABLE.
Wap to check for a pronic no.
ReplyDeletecheck out here https://intuition4science.blogspot.com/2020/07/find-number-is-pronic-or-not.html
DeleteShare this in your group... Contact whatsapp 7004646949