Question 1 : Write a program to determine whether a given number can be expressed as sum of two prime numbers or not.
For example 34 can be expressed as sum of two prime numbers but 23 cannot be.
Question 2 : Take a 2 or 3 digit input number, reverse it and add it to the original number until the obtained number is a palindrome or 5 iterations are completed.
Input : n = 32
Output : 55
23 + 32 = 55 which is a palindrome.
Input : 39
Output : 363
Question 3 : Given a string, reverse only vowels in it; leaving rest of the string as it is.
Input : abcdef
Output : ebcdaf
Question 4 : Write a program to check if the given words are present in matrix given below. The words can be left to right, top to bottom and the diagonals (in top to bottom direction)
Question 5 : Write a program to form lines using given set of words. The line formation should follow below rules.
i) Total characters in a single line excluding the space between the words and the favorite character should not exceed the given number.
ii) Favorite character is case insensitive.
iii) Words should not be broken up. Complete words alone should be used in a single line. A word should be used in one line only.
Input : Max char per line = 10 Favorite character = 'o' Words : Zoho, Eating, Watching, Pogo Loving, Mango Output : Watching Zoho Eating Mango Loving Pogo.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Related Practice Problems
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.