package com.xaygc; public class fortest { public static void main(String args[]){ int i,j,pat,sum=0; for(i=1;i<=20;i++){ pat=1; for(j=1;j<=i;j++){ pat=pat*j; } sum=sum+pat; } System.out.println("1!+2!+3!+....+20!="+sum); } }