aptitude are from number series and mixtures, C,C++ are from pointers Java from Threads, In programming round they asked, Program to print matrix in spiral form, Program to reverse vowels alone in a given string program to push all zeros to right side in an array and order should be maintained program to print name in a list like below if list contains 10-20 strings and if input is like c*i o/p should print all string in a list contains words starting with 'c' and ending with 'i' eg: list = [chennai, covai, madurai, delhi, dubai, mumbai] then if i/p = c*i o/p-->> chennai, covai if i/p = d*i o/p --->> dubai, delhi
Sigiloso
/* if list contains 10-20 strings and if input is like c*i o/p should print all string in a list contains words starting with 'c' and ending with 'i' eg: list = [chennai, covai, madurai, delhi, dubai, mumbai] then if i/p = c*i o/p-->> chennai, covai if i/p = d*i o/p --->> dubai, delhi */ package StringPrograms; import java.util.*; class Demo11 { public static void main(String[] args) { List l= new ArrayList(); l.add("chennai"); l.add("covai"); l.add("madurai"); l.add("delhi"); l.add("dubai"); l.add("mumbai"); System.out.println("Enter the pattern"); Scanner cn = new Scanner(System.in); String input=cn.nextLine(); String[] patternElements = input.split("\\*"); Iterator itr=l.iterator(); while(itr.hasNext()) { String element=(String)itr.next(); if(element.startsWith(patternElements[0])&&element.endsWith(patternElements[1])) { System.out.println(element); } } } } /* run: Enter the pattern m*i madurai mumbai BUILD SUCCESSFUL (total time: 3 seconds) */