STRING PROBLEMS ?
1. write a program to read student full name and print it in short form.

ex. Abul Pakhir Jainulladin Abdul Kalam
the short form is
A.P.J.A.Kalam

ANSWER...

2. write a program to read a string find out the string is palindrome or not.

ANSWER...

3. write a program to read a string, and rearrange all letters in sequence of lowercase, uppercase, digits, and special characters.

example
God's ForMula for SUCCESS is WORK.
the output is
odsorulaforisGFMSUCCESSWORK' .

ANSWER...

4. write a program to read a string and find the reverse string.

ANSWER...

5. Write a program to read a single word string and print the word in rhom bus format.

ANSWER...

6. Write a program to read a sentence string and print each word of a sentence in reverse.

Ex. LEADER MUST BE A SERVANT OF ALL.
Output:
REDAEL TSUM EB A TNAVRES FO LLA.

ANSWER...

7. Roman to Integer & Integer to Roman
Write a MENU-driven program to convert a Roman numeral string into an integer, and vice versa.
I – 1, II – 2 , III – 3, IV – 4, V – 5, VI – 6, VII – 7, VIII – 8, IX – 9, X - 10, XI – 11, XII – 12, ..... XX – 20, XXI – 21, ..... XL – 40, ..... L – 50, ... LX – 60,....XC – 90, ..... C - 100

EXAMPLE :
1. ROMAN TO INTEGER
2. INTEGER TO ROMAN
3. EXIT
ENTER YOUR CHOICE : 1
ENTER ROMAN NUMBER : XII
THE EQUIVALENT INTEGER IS 12

ANSWER...

8. Write a program to read a sentence string and find out the sentence is palindrome or not.
Ex. No lemon no melon - Palindrome sentence
Was it a car or cat i saw – Palindrome sentence

ANSWER...

9. Write a program to read a sentence string and print the longest word.

ANSWER...

10. write a program to read a string and remove all duplicate letters of a string.

ANSWER...

11. write a program to read a string, and remove all capital letters from the string.

ANSWER...

12. write a program to read a string, and remove all vowels from the string.

ANSWER...

13.

ANSWER...

14. write a program to read a string and print only vowel letters of string.

ANSWER...

15. write a program to read a string and print the missing alphabets in a string.

ANSWER...

16. Write a program to read a sentence string and remove particular word from the string.

ANSWER...

17. Write a program to accept a sentence which may be terminated by either ‘.’ , ‘?’ or‘!’ only. The words are to be separated by a single blank space and are in UPPERCASE.
Perform the following tasks:
(a) Check for the validity of the accepted sentence.
(b) Convert the non-palindrome words of the sentence into palindrome words byconcatenating the word by its reverse (excluding the last character).
Example: The reverse of the word HELP would be LEH (omitting the lastalphabet) and by concatenating both, the new palindrome word is
HELPLEH. Thus, the word HELP becomes HELPLEH.
Note: The words which end with repeated alphabets, for example ABBwould become ABBA and not ABBBA and XAZZZ becomesXAZZZAX.
[Palindrome word: Spells same from either side. Example: DAD, MADAM etc.]
(c) Display the original sentence along with the converted sentence.
Test your program for the following data and some random data:
Example 1
INPUT: THE BIRD IS FLYING.
OUTPUT: THE BIRD IS FLYING.
THEHT BIRDRIB ISI FLYINGNIYLF

Example 2
INPUT: IS THE WATER LEVEL RISING?
OUTPUT: IS THE WATER LEVEL RISING?
ISI THEHT WATERETAW LEVEL RISINGNISIR

Example 3
INPUT: THIS MOBILE APP LOOKS FINE.
OUTPUT: THIS MOBILE APP LOOKS FINE.
THISIHT MOBILELIBOM APPA LOOKSKOOL FINENIF

Example 4
INPUT: YOU MUST BE CRAZY#
OUTPUT: INVALID INPUT

ANSWER...

18. A new advanced Operating System, incorporating the latest hi-tech features has been designed by Opera Computer Systems. The task of generating copy protection codes to prevent software piracy has been entrusted to the Security Department. The Security Department has decided to have codes containing a jumbled combination of alternate uppercase letters of the alphabet starting from A upto K (namely among A,C,E,G,I,K). The code may or not be in the consecutive series of alphabets.
Each code should not exceed 6 characters and there should be no repetition of char acters. If it exceeds 6 characters, display an appropriate error message.
Write a program to input a code and its length. At the first instance of an error display "Invalid" stating the appropriate reason. In case of no error, display the message "Valid".

SAMPLE DATA

INPUT N=4 ABCE
OUTPUT Invalid Only alternate letters permitted!

INPUT N=4 AcIK
OUTPUT Invalid! Only upper case letters permitted!

INPUT N=4 AAKE
OUTPUT Invalid! Repetition of characters not permitted!

INPUT N=7

ANSWER...

19. write a program to read a string, and print its equivalent ascii string.

example INPUT String is ABdCz
the ASCII string is
656610067122

ANSWER...

20. write a program to read an ascii string, and print the original string.

example INPUT String is 656610067122
the ASCII string is
ABdCz

ANSWER...

21. write a program to read a string and count the UPPER case, LOWER case, and special symbols present in a string.

ANSWER...

22. write a program to read a compressed string, and print its original string.

example the compressed string is A2C4E4D
the original string is
AACCCCEEEED

ANSWER...

23. Write a program to read a sentence string and rearrange all the words of a sentence as per the alphabetical order.

ANSWER...

24.

ANSWER...

25. write a program to read a string, and compress the string.

example AACCCCEEEED
the compressed string is
A2C4E4D

ANSWER...

26.

ANSWER...

27. write a program to read a string and remove all extra blank spaces from the string.
[The blank space is said to be extra when it occurs before the string or after the string or espeically in between the words occurs more than once. ]

Example " The World rewards not the one who has knowledge
but the one who delivers. "

output
The World rewards not the one who has knowledge but the one who delivers.

ANSWER...

28. write a program to read a string and print only capital letters of string.

ANSWER...

29. Write a program to read an amount(in decimal format) and print its equivalent words.

Ex. 97723434.23
OUTPUT :
Nine Crore Seventy Seven Lakhs twenty three thousands four hundred and thirty four Rupees and twenty three paise only

ANSWER...

30. write a program to read a string and change all uppercase into lowercase, lowercase into uppercase.

ANSWER...

31. Write a program to read a sentence string and search a particular word x and replace it with new word y.

Ex. He is going to school.
search word : is
replace word : was
output : He was going to school.

ANSWER...

32. write a program to read a string and count the no. of words present in a string.

ANSWER...

33. Write a program to accept a sentence which may be terminated by either ‘.’,’?’ or’!’ only. The worlds may be separated by more than one blank space and are in UPPERCASE.
Perform the following tasks:
a. Find the number of words beginning and ending with vowel.
b. Place the words which begin and end with a vowel at the beginning, followed by the remaining words as they occur in the sentence.
Test your program with the sample data and some random data:
Example 1:
INPUT : ANAMIKA AND SUSAN ARE NEVER GOING TO QUARREL ANYMORE.
OUTPUR : NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL = 3
ANAMIKA ARE ANYMORE AND SUSAN NEVER GOING TO QUARREL

ANSWER...

34. write a program to read a string and print the largest character of string.

ANSWER...

Hungry Minds


HUNGRY MINDS
REG.NO. 09AKEPV9632M2Z9
Regd. Office : 120, Khirighat, Basti - 272002,
Uttar Pradesh , India.

Branch Office : No 91, Vallalar Nagar, V.M. Chatiram,
Tirunelveli - 627011, India

Our Services

School Software

Payment Gateway

Church Management Software

Mobile Apps

Ecommerce Site Development

Robotics Classes



hungryminds.basti@gmail.com

vasantharaj1972@gmail.com

- 2024 Copyright is Reserved. Hungry Minds 7779, India - 7985872766.