You are on page 1of 1

Programming Problems 12 (More on Strings) 1.

. Write a program that accepts a string s and a number n and copies n left most characters of the string to another string. For example, if the data given is computer, 3, then it must copy com in to the second string. The copying must be done using pointers. 2. Write a program that accepts a string s and a number n and copies n right most characters of the string to another string. For example, if the data given is computer, 3, then it must copy ter in to the second string. The copying must be done using pointers. 3. Write a program that accepts a string s and two numbers n1 and n2, and copies n2 characters of the string from the n1th position to another string. For example, if the data given is computer, 3, 2, then it must copy mp in to the second string. The copying must be done using pointers. 4. Write a program that accepts two strings str1, and str2, and checks whether str2 is present in str1. If it is present, it must print its position. If it is not present, an appropriate message must be printed. For example, if the strings given are ABCDEF and CD, then it must print the value 3. Try to develop the program using appropriate function and pointers. 5. Write a program that accepts 10 names and arranges them in alphabetical order. 6. Modify the program given in problem 5 such that the order of names must not be case sensitive.

You might also like