Computer Science, asked by Ssdsscv, 8 months ago

Q) 3+333+3333......10 terms
Program in java using scanner class

Answers

Answered by creatingmyselfrn
0

import java.util.*;

class series

{

static void display()

{

 long a=0;

 Scanner sc=new Scanner(System.in);

 System.out.println("Enter the number of terms you want");

 int n=sc.nextInt();

 for(int i=1;i<=n;i++)

  {

   a=(a*10)+3;

   System.out.print(a);

   if(i<n)

    System.out.print("+");

  }

Similar questions