/* Write a program to print the first 7 positive integers and their factorials. (The factorial of 1 is 1, the factorial of 2 is 1 * 2 = 2, the factorial of 3 is 1 * 2 * 3 = 6, the factorial of 4 is 1 * 2 * 3 * 4 = 24, etc.) */ for(int i=1;i<=7;i++) { int fac=1; for(int j=2;j<=i;j++) { fac*=j; } System.out.println("fatorila of "+i+" is "+fac ); }