I'll follow those who answer my question and mark the right one as brainliest
Java program to find sum of following series
1! + 2! + 3! + 4! +5!
using for loop
add output also
Answers
Answered by
0
public class series
{
public static void main(String[] args)
{
int i,f,j,s=0;
for(i=1;i<=5;i++)
{
f=1;
for(j=1;j<=i;j++)
{
f=f*j;
}
s=s+f;
}
System.out.println("Sum : "+s);
}
}
Hope it helps you...
Please mark it as brainliest...
☺️☺️☺️
Output:
Sum : 153
Similar questions