write a program :
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Answers
Answer:
import java.util.Scanner;
public class Sum_Series
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int n = sc.nextInt();
System.out.println();
int k=1;
int sum=0;
for(int i=1;i<n;i++)
{
k=i;
sum=0;
for(int j=i;j<n;j++)
{
sum += j;
if(sum==n)
{
for(int z=i;z<j;z++)
{
System.out.print(z+"+");
}
System.out.print(j);
System.out.println();
break;
}
}
}
}
}
Here is your answer.
Explanation:
HOPE IT HELP'S...........