1.

WAP in java to display the series using loop.1,11,111,1111,11111​

Answer»

Answer:

well here is it

Explanation:

import java.util.Scanner;

public CLASS Series  

{

 public static VOID main(STRING args[])

 {

  Scanner sc = new Scanner(System.in);

 

  int s = 0, c;                                          // s for terms of series, c for n terms

  for (c = 1; c <= 5; c++)                          // To generate 5 terms

  {

   s = s * 10 + 1;

   System.out.print(s + " ");

  }                                                           //for  ends

 }

}

hope it is helpful,

mark it brainliest,

mark it brainliest,follow me for further help

have a good day



Discussion

No Comment Found