Prerequisite – PL/SQL introduction
In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations.
Given a string and the task is to find the number of vowels and consonants present in the string.
Examples:
Input: str = 'Ramesh'
Output: Vowels = 2, Consonants = 4
Input: str = 'Ramesh is a Geek'
Output: Vowels = 6, Consonants = 7
Approach is to consider a character one by one and maintain a separate count for both vowels and consonants.
Below is the required implementation:
<div id= "highlighter_484083" class= "syntaxhighlighter nogutter " >< table border= "0" cellpadding= "0" cellspacing= "0" ><tbody><tr><td class= "code" ><div class= "container" ><div class= "line number1 index0 alt2" ><code class= "keyword" > DECLARE </code> </div><div class= "line number2 index1 alt1" ><code class= "undefined spaces" > </code><code class= "comments" >
|
Output :
No. of Vowels: 6
No. of Consonants: 7
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our
Complete Interview Preparation Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our
Complete Interview Preparation course.
Last Updated :
05 Jul, 2018
Like Article
Save Article