Exercise On Output Formatting
Exercise On Output Formatting
import java.util.*;
// --------------------------------------------------------
}
}
Sample Dialog:
List the first n Even numbers
Enter integer [1 to 20] : 10
Even(10) : {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}
Let's do Summation of n
Enter integer [1 to 20] : 10
S(10) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
Let's do Factorial of n
Enter integer [1 to 10] : 10
10! = 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 = 3628800