Arif and Caleb both are friends. Both are planning to utilize the vacation holidays by learning a programming language. They learned the concept of the pointer and want to know the knowledge level.
So they decided to make a coding test for each other.
Arif wrote a name in the paper, Caleb wants to count the vowels and consonants. Can you help Caleb?
Input:
The only input is a string
Output:
The number of vowels and consonants.
#include <stdio.h> #include <string.h> int main() { int c1=0,c2=0; char str[150]; char *pt; scanf("%s", str); pt=str; while(*pt!='\0') { if(*pt=='a'||*pt=='e'||*pt=='i'||*pt=='o'||*pt=='u'||*pt=='A'||*pt=='E'||*pt=='I'||*pt=='O'||*pt=='U'){ c1++; } else c2++; pt++; } printf("vowels:%d\nconsonants:%d\n",c1,c2); return 0; }
INPUT_1:
FcukTheCode
OUTPUT:
vowels:4
consonants:7
INPUT_2:
Gambling
OUTPUT:
vowels:2
consonants:6
INPUT_3:
Retreat
OUTPUT:
vowels:3
consonants:4
ILLUSTRATION
Morae Q!
- Find the length of the array’s longest increasing sub-sequence.
- Arrange numbers in a circle so that any two neighbouring numbers differ by 1.
- Find partial names and count the total numbers.
- Find the minimized sum of non-deleted elements of the array after the end of the game.
- Find the maximum number of good sleeping times optimally.
- Sort the elements of the array in the order in which they are required.
- Find the minimum number of flats, monkey needs to visit to catch ninjas.
- Convert the square matrix to matrix in Z form.
- Shift the K elements of each row to right of the matrix.
- Find maximum possible number of students in a balanced team with skills.
- Find the Maximum number of pairs of points you can match with each other.
- Calculate the number of non-empty good subarrays of given array.
- Transform the binary string A into the string B using finite operations.
- Find the number of potion must the character take to jump the hurdles.
- Count the total number of vowels and consonants.
- Return all elements of the matrix in spiral order.
- Return all palindromic paths of the matrix.
- Write the code to change the display in reverse order using pointer.
- Find the number of days the expedition can last.
- Find the minimum size of the sub-segment to make the array pairwise distinct.