Computer Science, asked by AritroRoy, 1 year ago

wap to obtain the first eight numbers of the following series 1,11,111,1111,.....

Answers

Answered by Richa189381
0
11111,111111,1111111,11111111,111111111

AritroRoy: What have you answered? ?
Richa189381: sorry I thought something else
AritroRoy: What do you mean by ZM in your profile
Richa189381: zayn malik
satwikmishra00pa62q0: Preferences
Answered by TechNinja
2
import java.util.Scanner;
public class Series  
{
 public static void main(String args[])
 {
  Scanner sc = new Scanner(System.in);
  System.out.print("Enter the number of terms: ");
  int n = sc.nextInt();
  int s = 0, c;                                          // s for terms of series, c for n terms
  for (c = 1; c <= n; c++)                          // To generate n terms
  {
   s = s * 10 + 1;
   System.out.print(s + " ");
  }                                                           //for  ends
 }
}
please mark as brainliest

RodolfoLiuwen: it's superb
AritroRoy: In which class do you study in
Richa189381: 10
AritroRoy: Thanks Techninja
Similar questions