How to print out the number of capital letters in a string.
Improve this sample solution and post your code through Disqus. Previous: Write a program in C to find the length of a string without using library function. Next: Write a program in C to print individual characters of string in reverse order.
C Program to display alternate characters in string. Online C String programs for computer science and information technology students pursuing BE, BTech, MCA, MTech, MCS, MSc, BCA, BSc. Find code solutions to questions for lab practicals and assignments.
Write a C Program to Convert a person's name in abbreviated form. by Dinesh Thakur Category: C Programming (Pratical) Let us use character arrays fname, mname and lname to store the first name, middle name and last name of a person.
Now, iterate through the string to compare each character with rest of the string. Increment the count of corresponding element in freq. Finally, iterate through freq to display the frequencies of characters. For example: Frequency of p in above string is 2. Algorithm. Define a string. Define an array freq with the same size of the string.
C Program to Remove or Delete Spaces from String or Sentence. To remove or delete spaces from string, you have to ask to the user to enter a string or sentence, now check for spaces. If space will be found, then start placing the next character from the space to the back until the last character and so on.
Example: Program to count number of digits and white spaces in a String In this program we have a string object to store the input string. If you want you can also use char array in place of string object but the problem with char array is that it has a fixed size, which means if you define a char array of size 100 and user enters string longer than the program will truncate the string.
Assuming that you want to uppercase only the vowels in a String, you can write a loop to go through all the chracters in a String and when a character is a vowel you can convert it to uppercase.