0% found this document useful (0 votes)
6 views

String Question

Uploaded by

sharaneswara2007
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)
6 views

String Question

Uploaded by

sharaneswara2007
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/ 1

String Question

1. Write a C program to calculate the length of a given string without using the built-in
strlen() function.
Input : C Lab Output : 4 (Space considered zero value)
2. Write a C program that reverses a given string in place (i.e., without using any additional
arrays).
Input : C Lab Output: C Lab
3. Write a program that checks if a string is a palindrome (i.e., the string reads the same
forwards and backwards). You should ignore case and spaces when checking.
4. Implement a program that searches for a substring within a string. The program should
return the index of the first occurrence of the substring or indicate if the substring is not
found.
5. Write a C program that extracts and prints all the digits from a given string. For example,
given the string "Hello123World456", the output should be "123456".
6. Write a C program to implement basic string compression using run-length encoding. For
example, given the string "aaabbbcccc", the program should output "a3b3c4".

You might also like