Previous Next
0 / 23
Module DEMO-32-108DEMO-C-32

Count Consonants

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a program that counts the number of consonants in a string. A consonant is any alphabetic character that is not a vowel.

Constraints

Max string length: 100

Input Format

Input:

String S

Output Format

Output:

Count

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
Union!6
2
There are 2 consonants in Union!6.
Sample #2
Public sample
Component?5
6
There are 6 consonants in Component?5.
Sample #3
Public sample
Overflow#4
5
There are 5 consonants in Overflow#4.
Sample #4
Public sample
Angular!7
4
There are 4 consonants in Angular!7.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings