Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
40 views2 pages

6 String

Uploaded by

Sameer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

6 String

Uploaded by

Sameer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

String:-

-----------------------------------------------------------------------------------------------------------------------------------

1) Write a program to find string length using pointer.

2) Write a one line code to copy the string into another buffer.

3) Write a program to find the no.of times the character is found in a given string.

4) Write a program to find vowels in a given string.

5) Write a program to compare two strings without using strcmp function.

6) Write a program to reverse the string using loops & using recursion.

7) Write a program to check the given strings are palindrom or not.


Note: Palindrome words are words which read and spell the same way both backwards
and forwards. Some examples,
madam, level , radar, stats and etc.

8) Write a program to find the no.of words are presented in a given string line.
Note: User has to input the string line at runtime.

9) Write a program to delete a desired character in a given string.


Ex: Input : embedded
character: 'd'
Output : embee

10) Write a program to remove the conjucutive spaces in a given string line.
Ex: Input: Vector India Pvt Ltd
Output: Vector India Pvt Ltd;

11) Write a program to delete the duplicate characters in a given string.


Ex: Input : vecteeovvorr
Output : vector

12) Write a program to print the count of duplicate characters in a given string.
Ex: Input : “hrithik roshan”
Output: Letter ------- Count
h ------- 3
r ------- 2
i ------- 2

13) Write a program to find count of Lower characters, Upper characters, Special characters
and digits occured in a given string.

14) Write a program to convert the characters Upper to Lower and Lower to Upper in a
given string.

15) Write a program to sort a given string in ascending order.

16) Write a program to accept two strings from user into two character array and copy one
by one character into another destination array.
Ex: First String : “abcdefg”
Second String : “1234”
then Destination String is “a1b2c3d4efg”

17) Write a program to find the no.of times substring is found in a given string.

18) Write a program to reverse the words in a given string line.


Ex : “I am a good boy”
“I ma a doog yob”

19) Write a program to replace the words in reverse order in a given string line.
Ex: Input : “world changed your thoughts”
Output : “thoughts your changed world”

20) Write a program to read two strings through the keyboard like the following example
and replace any word of the second string with the first string.
Ex: Input:- Fist String : “Tomorrow”
Second String : “Today is Sunday”
Replace word : “Today”.
Output:- “Tomorrow is Sunday”

21) Write a program to check given strings are anagram or not.


An anagram is a rearrangement of the letters of one word or phrase to form another word or phrase.
Note : Both strings are anagram, if both contains same elements, same no.of times in any order.
(Can have extra special characters & digits also, but non-alphabets should not be counted)

Ex: "Osama bin laden" & "Old man in a base" both are anagrams.
“study” & “dus%@ty123” both are anagrams.
Here after removing special characters and digits ----> “ dusty “.

22) Write a program for Decryption of a given Encrypted string line with respect to given
key number.
The letter at position of the key and a multiple of key is interchanged with the next
letter. Spaces and special characters are to be ignored. If the letter is the last one in the
array, then no interchange is required.
Design a function called Decryptor to receive the Encrypted data from the main
function and decrypt the data.

4 8 12 16 20 24 28 32 36
Ex: Input String : “Expcet Porblmes adn eat thef mor rbeafkast”.
If Key : 4 then, 4 multiples ---> 4,8,12,16,20,24,28,32,36 these letters has to interchange with next
Characters.
Output String : “Expect Problems and eat them for breakfast”.

----------------------------------------------------------- END --------------------------------------------------------------

You might also like