Consider the series:- 1, 1, 2, 3, 4, 9, 8, 27, 16, 81, 32, 243, 64 ...........and so on. Find the nth term in the given series ? ex:- 9 th term print 16 6 th term print 9 Note:- We have to print only nth term not the whole series up to nth term. Explanation:- The given series is a combination of two geometric progression series. First series ( odd positions ) :- 1, 2, 4, 8, 16, 32, 64, ........and so on. 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 ,……. Second series ( even positions ) :- 1, 3, 9, 27, 81, 243,..... and so on. 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 ……. Java 1 2 3 4 5 6 7 8 9 10 11 import java.util.Scanner; public class Series{ public static void main (S
This blog contains coding/programming and interview questions of MNCs like TCS, Wipro, Infosys, Capgemini, Mindtree, Amazon, Google, Facebook, Flipkart, Cisco, HP, Dell, etc. with placement preparation guides.