import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input a positive integer: ");
int n = in .nextInt();
int result = (n * (n + 1) / 2) * (1 << (n - 1));
System.out.print("Sum of subsets of n is : " + result);
}
}
Sample Output:
Input a positive integer: 25
Sum of subsets of n is : 1157627904
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer