Q. Write a program to print first letters of each word in a string if it is a vowel. Explanation: Let us consider a string "Ellen is my cousin's friend" In the above string 'E' 'i' are first letters of string and it is vowel so it should print the two letters. Program: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); String st=sc.nextLine(); String Words[]=st.split(" "); for(int i=0;i<Words.length;i++){ String s=Words[i]; s=s.toLowerCase(); if(s.charAt(0)=='a'|| s.charAt(0)=='e'|| s.charAt(0)=='i'|| s.charAt(0)=='o'|| s.charAt(0)=='u'){ System.out.println(s.charAt(0)); } } } }
Questions In HR Round - 1. Self introduction. 2. What do you know about TCS? 3. Who is the CEO of TCS ? 4. Tell me about your family background. 5. About Relocation. 6. Tell me about your father. 7. What would you do if I reject u ( I said I will try to find out why I was rejected n try to improve in those areas n again apply for the job in TCS) 9. HR: What if I again reject u [ This is just an example, elaborate it depending on the job description ] Me : I have seen in job description that one should be a good team player n adaptive for this role , apart from my academics I'm a good team player n adaptive so I don't think I'll be rejected. HR: okay Ur documents will be verified before joining if we hire u. That's all... ALL THE BEST