C Programming: Count the number of punctuation characters exists in a string
26. Count Punctuation Characters
Write a program in C to count the number of punctuation characters present in a string.
Sample Solution:
C Code:
Output:
Count the number of punctuation characters exists in a string : ------------------------------------------------------------------ Input a string : The quick brown fox,jumps over the,lazy dog. The punctuation characters exists in the string is : 3
Flowchart:
For more Practice: Solve these Related Problems:
- Write a C program to iterate through a string and count all punctuation marks using ASCII value ranges.
- Write a C program to detect and count specific punctuation symbols like commas, periods, and semicolons.
- Write a C program to traverse a string and display the total count of punctuation characters found.
- Write a C program to count punctuation characters while ignoring alphanumeric characters, using manual checks.
C Programming Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a program in C to replace the spaces of a string with a specific character.
Next: Write a program in C to print only the string before new line character.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.