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

C String Ex

The document provides code examples for finding the number of characters in a string, reversing a string, finding the index of the first occurrence of a character in a string, and removing the first occurrence of a word from a string.

Uploaded by

Hoàng Trang My
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

C String Ex

The document provides code examples for finding the number of characters in a string, reversing a string, finding the index of the first occurrence of a character in a string, and removing the first occurrence of a word from a string.

Uploaded by

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

1.

C program to find total number of alphabets, digits or special characters in a string


Input
Input string: Today is Mon, 15/03
Output
Alphabets = 10
Digits = 4
Special characters = 1
2. C program to find reverse of a string
Input: Hello
Output
Reverse string: olleH

3. C program to find the first occurrence of a character in a string


Input
Input string: Hello
Input character to search: o
Output
'o' is found at index 4

4. C program to remove first occurrence of a word from string


Input
Input string : Hello world.
Input word to remove : o
Output
Hell wrld

You might also like